]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Add percentages to offset histogram
authorStella Lau <laus@fb.com>
Fri, 14 Jul 2017 18:00:20 +0000 (11:00 -0700)
committerStella Lau <laus@fb.com>
Fri, 14 Jul 2017 18:00:20 +0000 (11:00 -0700)
contrib/long_distance_matching/ldm.c
contrib/long_distance_matching/ldm.h

index 186fa08eb0628b72f556fd34335cbcd583bf9548..d935a2bdf4df73454b953f4d5d61b87515b2fcb4 100644 (file)
@@ -135,7 +135,10 @@ void LDM_printCompressStats(const LDM_compressStats *stats) {
   printf("\n");
   printf("offset histogram\n");
   for (; i <= intLog2(stats->maxOffset); i++) {
-    printf("2^%*d: %10u\n", 2, i, stats->offsetHistogram[i]);
+    printf("2^%*d: %10u    %6.3f%%\n", 2, i,
+           stats->offsetHistogram[i],
+           100.0 * (double) stats->offsetHistogram[i] /
+                   (double)stats->numMatches);
   }
   printf("\n");
 
index 0e54faa70e836f67a87897daec6e7550cac58889..3c8c04ecca639514db5c28d34c8e508726a1f761 100644 (file)
@@ -19,8 +19,8 @@
 #define WINDOW_SIZE (1 << 25)
 
 //These should be multiples of four.
-#define LDM_MIN_MATCH_LENGTH 4
-#define LDM_HASH_LENGTH 4
+#define LDM_MIN_MATCH_LENGTH 1024
+#define LDM_HASH_LENGTH 1024
 
 typedef U32 offset_t;
 typedef U32 hash_t;