//**************************************\r
// Tuning parameters\r
//**************************************\r
-// COMPRESSIONLEVEL :\r
-// Increasing this value improves compression ratio\r
-// Lowering this value reduces memory usage\r
-// Reduced memory usage typically improves speed, due to cache effect (ex : L1 32KB for Intel, L1 64KB for AMD)\r
-// Memory usage formula : N->2^(N+2) Bytes (examples : 12 -> 16KB ; 17 -> 512KB)\r
-#define COMPRESSIONLEVEL 12\r
+// MEMORY_USAGE :\r
+// Memory usage formula : N->2^N Bytes (examples : 10 -> 1KB; 12 -> 4KB ; 16 -> 64KB; 20 -> 1MB; etc.)\r
+// Increasing memory usage improves compression ratio\r
+// Reduced memory usage can improve speed, due to cache effect\r
+// Default value is 14, for 16KB, which nicely fits into Intel x86 L1 cache\r
+#define MEMORY_USAGE 14\r
\r
// NOTCOMPRESSIBLE_CONFIRMATION :\r
// Decreasing this value will make the algorithm skip faster data segments considered "incompressible"\r
#define LZ4_COMPRESSMIN 0\r
\r
// BIG_ENDIAN_NATIVE_BUT_INCOMPATIBLE :\r
-// This will provide a boost to performance for big endian cpu, but the resulting compressed stream will be incompatible with little-endian CPU.\r
-// You can set this option to 1 in situations where data will stay within closed environment\r
+// This will provide a small boost to performance for big endian cpu, but the resulting compressed stream will be incompatible with little-endian CPU.\r
+// You can set this option to 1 in situations where data will remain within closed environment\r
// This option is useless on Little_Endian CPU (such as x86)\r
//#define BIG_ENDIAN_NATIVE_BUT_INCOMPATIBLE 1\r
\r
//**************************************\r
#define MINMATCH 4\r
\r
-#define HASH_LOG COMPRESSIONLEVEL\r
+#define HASH_LOG (MEMORY_USAGE-2)\r
#define HASHTABLESIZE (1 << HASH_LOG)\r
#define HASH_MASK (HASHTABLESIZE - 1)\r
\r