diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:45:59 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:45:59 +0000 |
commit | 19fcec84d8d7d21e796c7624e521b60d28ee21ed (patch) | |
tree | 42d26aa27d1e3f7c0b8bd3fd14e7d7082f5008dc /src/isa-l/igzip/igzip_build_hash_table_perf.c | |
parent | Initial commit. (diff) | |
download | ceph-upstream.tar.xz ceph-upstream.zip |
Adding upstream version 16.2.11+ds.upstream/16.2.11+dsupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/isa-l/igzip/igzip_build_hash_table_perf.c')
-rw-r--r-- | src/isa-l/igzip/igzip_build_hash_table_perf.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/isa-l/igzip/igzip_build_hash_table_perf.c b/src/isa-l/igzip/igzip_build_hash_table_perf.c new file mode 100644 index 000000000..1c80dc8b0 --- /dev/null +++ b/src/isa-l/igzip/igzip_build_hash_table_perf.c @@ -0,0 +1,38 @@ +#include <stdio.h> +#include <stdlib.h> +#include <assert.h> +#include <string.h> +#include <getopt.h> +#include "igzip_lib.h" +#include "test.h" + +#define DICT_LEN 32*1024 + +extern void isal_deflate_hash(struct isal_zstream *stream, uint8_t * dict, int dict_len); + +void create_rand_data(uint8_t * data, uint32_t size) +{ + int i; + for (i = 0; i < size; i++) { + data[i] = rand() % 256; + } +} + +int main(int argc, char *argv[]) +{ + int time = BENCHMARK_TIME; + struct isal_zstream stream; + uint8_t dict[DICT_LEN]; + uint32_t dict_len = DICT_LEN; + + stream.level = 0; + create_rand_data(dict, dict_len); + + struct perf start; + BENCHMARK(&start, time, isal_deflate_hash(&stream, dict, dict_len)); + + printf("igzip_build_hash_table_perf: in_size=%u ", dict_len); + perf_print(start, (long long)dict_len); + + return 0; +} |