]> git.proxmox.com Git - ceph.git/blame - ceph/src/isa-l/igzip/igzip_build_hash_table_perf.c
Import ceph 15.2.8
[ceph.git] / ceph / src / isa-l / igzip / igzip_build_hash_table_perf.c
CommitLineData
f91f0fd5
TL
1#include <stdio.h>
2#include <stdlib.h>
3#include <assert.h>
4#include <string.h>
5#include <getopt.h>
6#include "igzip_lib.h"
7#include "test.h"
8
9#define DICT_LEN 32*1024
10
11extern void isal_deflate_hash(struct isal_zstream *stream, uint8_t * dict, int dict_len);
12
13void create_rand_data(uint8_t * data, uint32_t size)
14{
15 int i;
16 for (i = 0; i < size; i++) {
17 data[i] = rand() % 256;
18 }
19}
20
21int main(int argc, char *argv[])
22{
23 int time = BENCHMARK_TIME;
24 struct isal_zstream stream;
25 uint8_t dict[DICT_LEN];
26 uint32_t dict_len = DICT_LEN;
27
28 stream.level = 0;
29 create_rand_data(dict, dict_len);
30
31 struct perf start;
32 BENCHMARK(&start, time, isal_deflate_hash(&stream, dict, dict_len));
33
34 printf("igzip_build_hash_table_perf: in_size=%u ", dict_len);
35 perf_print(start, (long long)dict_len);
36
37 return 0;
38}