From: Stella Lau Date: Fri, 14 Jul 2017 18:00:20 +0000 (-0700) Subject: Add percentages to offset histogram X-Git-Tag: v1.3.1^2~12^2~7^2~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=55f960e8db9e3df9322ae9c973c699f671f51c90;p=thirdparty%2Fzstd.git Add percentages to offset histogram --- diff --git a/contrib/long_distance_matching/ldm.c b/contrib/long_distance_matching/ldm.c index 186fa08eb..d935a2bdf 100644 --- a/contrib/long_distance_matching/ldm.c +++ b/contrib/long_distance_matching/ldm.c @@ -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"); diff --git a/contrib/long_distance_matching/ldm.h b/contrib/long_distance_matching/ldm.h index 0e54faa70..3c8c04ecc 100644 --- a/contrib/long_distance_matching/ldm.h +++ b/contrib/long_distance_matching/ldm.h @@ -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;