Add more statistics

This commit is contained in:
Stella Lau
2017-07-14 12:31:01 -07:00
parent 55f960e8db
commit 2d8e6c6608
2 changed files with 62 additions and 18 deletions
+14 -5
View File
@@ -11,16 +11,17 @@
#define LDM_OFFSET_SIZE 4
// Defines the size of the hash table.
#define LDM_MEMORY_USAGE 20
#define LDM_MEMORY_USAGE 16
#define LDM_HASHLOG (LDM_MEMORY_USAGE-2)
#define LDM_HASHTABLESIZE (1 << (LDM_MEMORY_USAGE))
#define LDM_HASHTABLESIZE_U32 ((LDM_HASHTABLESIZE) >> 2)
#define WINDOW_SIZE (1 << 25)
#define LDM_WINDOW_SIZE_LOG 25
#define LDM_WINDOW_SIZE (1 << (LDM_WINDOW_SIZE_LOG))
//These should be multiples of four.
#define LDM_MIN_MATCH_LENGTH 1024
#define LDM_HASH_LENGTH 1024
#define LDM_MIN_MATCH_LENGTH 4
#define LDM_HASH_LENGTH 4
typedef U32 offset_t;
typedef U32 hash_t;
@@ -70,9 +71,17 @@ void LDM_initializeCCtx(LDM_CCtx *cctx,
* Prints the percentage of the hash table occupied (where occupied is defined
* as the entry being non-zero).
*/
void LDM_outputHashtableOccupancy(const LDM_hashEntry *hashTable,
void LDM_outputHashTableOccupancy(const LDM_hashEntry *hashTable,
U32 hashTableSize);
/**
* Prints the distribution of offsets in the hash table.
*
* The offsets are defined as the distance of the hash table entry from the
* current input position of the cctx.
*/
void LDM_outputHashTableOffsetHistogram(const LDM_CCtx *cctx);
/**
* Outputs compression statistics to stdout.
*/