How to configure and user zswap/zram to improve performance
It was often stated that systems configured with sufficient CPU and RAM,
did not need to be configured with a swap partition or swap file, and
that adding swap would decrease performance. Numerous documents and
performance benchmarks have disproved this many times, but debating
the +/- of swap is not the goal of this KB.
Configuring disk-based or ram-based swap space on a host is almost
always beneficial, except in very specific constrained situations such
as embedded or real-time (RTOS) situations.
This KB will describe in detail how to configure 'zswap', a compressed
swap filesystem, and 'zram' a RAM-based swapfile on your host for maxmimum
performance, and when to decide which one is the best choice to use for
your specific workloads.
However, Haskell's type system is special in a way that makes the
second law follow from the first one. The values of *every* type follow
a certain law; this law is called the free theorem of that type.
This holds for all `g`; so from the type of `f` alone, one can deduce
that we can rearrange it in a chain of `map`s to be in any place we want.
Pretty cool how something like that can be derived from a type alone!