Testing the KAEZlib Library
After installing the zlib library (KAE 1.0) or KAEZlib library (KAE 2.0), you can test the library functions and performance based on the operations provided in this section.
Perform the test operations in the source code directory. If KAE is installed using an RPM or DEB package, download and decompress the KAE source package before the test.
- Go to the test directory in the KAE source code directory.
- KAE 1.0
1cd kae_zip_engine/test/
- KAE 2.0
1cd KAEZlib/test/gtest/
- KAE 1.0
- Test the KAEZlib library functions.
1 2 3 4
mkdir build && cd build cmake .. make ./zlib_functest --gtest_filter=*Case*
In the command output, if the execution results of both SmallCase and LargeCase are passed, the KAEZlib library functions are normal.
- Test the performance.
- Set the environment variable LD_LIBRARY_PATH and enable the KAEZlib library.
1export LD_LIBRARY_PATH=/usr/local/kaezip/lib:$ LD_LIBRARY_PATH
- Go to the performance test directory.
- KAE 1.0
1cd kae_zip_engine/test
- KAE 2.0
1cd KAEZlib/test/perftest
- KAE 1.0
- Compile the performance test tool.
1make
- Test the compression performance.
- Testing the compression performance of the native zip library
1./zip_perf -m 8 -l 10240 -n 1000
Command output:
1 2 3 4 5 6 7 8 9 10 11 12
kaezip perf parameter: multi process 8, stream length: 10240(KB), loop times: 1000, windowBits : 15, level : 6 input_size is 10485760B compress_size is 10488746B = 10.003MB, compress_rate is 100.028% compress_size is 10488746B = 10.003MB, compress_rate is 100.028% compress_size is 10488746B = 10.003MB, compress_rate is 100.028% compress_size is 10488746B = 10.003MB, compress_rate is 100.028% compress_size is 10488746B = 10.003MB, compress_rate is 100.028% compress_size is 10488746B = 10.003MB, compress_rate is 100.028% compress size is 10488746B = 10.003MB, compress_rate is 100.028% compress_size is 10488746B = 10.003MB, compress_rate is 100.028% kaezip compress perf result: time used: 335108108 us, speed = 0.233 GB/s
- Testing the compression performance of the KAEzip library
1./kaezip_perf -m 8 -l 10240 -n 1000
Command output:1 2 3
kaezip perf parameter: multi process 8, stream length: 10240(KB), loop times: 1000 kaezip compress perf result: time used: 10631524 us, speed = 7.348 GB/s
It shows that the compression speed rises from 0.233 GB/s to 7.348 GB/s.
- Testing the compression performance of the native zip library
- Test the decompression performance.
- Testing the decompression performance of the native zip library
1./zip_perf -d -m 8 -f itemdata.zlib -n 1000
Command output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
kaezip perf parameter: multi process 8, stream length: 1024(KB), loop times: 1000, windowBits : 15, level : 6 g_kae_device_num 2 uncompress filename : itemdata.zlib input_size is 3539153B [169064]uncompress_size is 7316868B = 6.978MB [169063]uncompress_size is 7316868B = 6.978MB [169061]uncompress_size is 7316868B = 6.978MB [169062]uncompress_size is 7316868B = 6.978MB [169060]uncompress_size is 7316868B = 6.978MB [169058]uncompress_size is 7316868B = 6.978MB [169059]uncompress_size is 7316868B = 6.978MB [169065]uncompress_size is 7316868B = 6.978MB 8 multi process kaezip decompress perf result: time used: 36786657 us, speed = 1.482 GB/s
- Testing the decompression performance of the KAEzip library
1./kaezip_perf -d -m 8 -f itemdata.zlib -n 1000
Command output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
kaezip perf parameter: multi process 8, stream length: 1024(KB), loop times: 1000, windowBits : 15, level : 6 g_kae_device_num 2 uncompress filename : itemdata.zlib input_size is 3539153B [168826]uncompress_size is 7316868B = 6.978MB [168825]uncompress_size is 7316868B = 6.978MB [168830]uncompress_size is 7316868B = 6.978MB [168827]uncompress_size is 7316868B = 6.978MB [168823]uncompress_size is 7316868B = 6.978MB [168829]uncompress_size is 7316868B = 6.978MB [168828]uncompress_size is 7316868B = 6.978MB [168824]uncompress_size is 7316868B = 6.978MB 8 multi process kaezip decompress perf result: time used: 5785818 us, speed = 9.422 GB/s
It shows that the decompression speed rises from 1.482 GB/s to 9.422 GB/s.
In the decompression command, itemdata.zlib indicates the compressed file, which can be specified by adding -o itemdata.zlib to the compression command.
- Testing the decompression performance of the native zip library
- Set the environment variable LD_LIBRARY_PATH and enable the KAEZlib library.