Add percentages to offset histogram

This commit is contained in:
Stella Lau 2017-07-14 11:00:20 -07:00
parent 4db7f12ef3
commit 55f960e8db
2 changed files with 6 additions and 3 deletions

View 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");

View 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;