Synchronous Test
After installing the KAELz4 library, perform operations described in this section to test its synchronous functions and performance using test scripts of the open source compression algorithm in /KAE/KAELz4/open_source/lz4-1.9.4/test and the kunpeng-lzbench test tool.
- Install KAELz4. For details, see Installation Using Source Code.
- Obtain lzbench source code from the Gitee repository and run the make command in the source code path to compile the source code to generate a binary tool.
- Test the functions of the LZ4 compression library.
1 2 3
cd /KAE/KAELz4/open_source/lz4-1.9.4/tests make ./fullbench datagen
- Test the performance.
- Go to the lzbench source code path and check the algorithm library used by the test tool.
ldd lzbench
If the following information is displayed, the open source Lz4 algorithm library is used:linux-vdso.so.1 (0x0000ffffae181000) libz.so.1 => /usr/lib64/libz.so.1 (0x0000ffffae113000) libzstd.so.1 => /usr/lib64/libzstd.so.1 (0x0000ffffae012000) liblz4.so.1 => /usr/lib64/liblz4.so.1 (0x0000ffffadfe1000) libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x0000ffffaddeb000) libm.so.6 => /usr/lib64/libm.so.6 (0x0000ffffadd4a000) libgcc_s.so.1 => /usr/lib64/libgcc_s.so.1 (0x0000ffffadd19000) libc.so.6 => /usr/lib64/libc.so.6 (0x0000ffffadb6a000) /lib/ld-linux-aarch64.so.1 (0x0000ffffae144000)
- Test the decompression performance of the open source Lz4 algorithm library. The test file is stored in KAE/scripts/compressTestDataset.
taskset -c 1 ./lzbench -relz4 -b8 -i1 -j -m1024 /pathtoKAE/scripts/compressTestDataset/
Command output:
lzbench 1.8 (64-bit Linux) (null) Assembled by P.Skibinski Compressor name Compress. Decompress. Orig. size Compr. size Ratio Filename memcpy 26722 MB/s 27211 MB/s 102760022 102760022 100.00 8 files lz4 1.9.4 472 MB/s 2900 MB/s 102760022 61462487 59.81 8 files done... (cIters=1 dIters=1 cTime=1.0 dTime=2.0 chunkSize=8KB cSpeed=0MB)
- Set the environment variable LD_LIBRARY_PATH to enable the KAELz4 library, and check the algorithm library used by the test tool.
1 2
export LD_LIBRARY_PATH=/usr/local/kaelz4/lib:$LD_LIBRARY_PATH ldd lzbench
If the following information is displayed, the KAELz4 algorithm library is used:linux-vdso.so.1 (0x0000ffffac665000) libz.so.1 => /usr/lib64/libz.so.1 (0x0000ffffac5f7000) libzstd.so.1 => /usr/lib64/libzstd.so.1 (0x0000ffffac4f6000) liblz4.so.1 => /usr/local/kaelz4/lib/liblz4.so.1 (0x0000ffffac4b5000) libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x0000ffffac2bf000) libm.so.6 => /usr/lib64/libm.so.6 (0x0000ffffac21e000) libgcc_s.so.1 => /usr/lib64/libgcc_s.so.1 (0x0000ffffac1ed000) libc.so.6 => /usr/lib64/libc.so.6 (0x0000ffffac03e000) /lib/ld-linux-aarch64.so.1 (0x0000ffffac628000) libkaelz4.so.2.0.4 => /usr/local/kaelz4/lib/libkaelz4.so.2.0.4 (0x0000ffffac00b000) libwd.so.2 => /usr/local/lib/libwd.so.2 (0x0000ffffabfaa000) libwd_comp.so.2 => /usr/local/lib/libwd_comp.so.2 (0x0000ffffabf79000) libnuma.so.1 => /usr/lib64/libnuma.so.1 (0x0000ffffabf54000)
- Test the decompression performance of KAELz4.
taskset -c 1 ./lzbench -relz4 -b8 -i1 -j -m1024 ../../../../scripts/compressTestDataset/
Command output:
lzbench 1.8 (64-bit Linux) (null) Assembled by P.Skibinski Compressor name Compress. Decompress. Orig. size Compr. size Ratio Filename memcpy 26929 MB/s 26177 MB/s 102760022 102760022 100.00 8 files lz4 1.9.4 840 MB/s 3030 MB/s 102760022 58783964 57.21 8 files done... (cIters=1 dIters=1 cTime=1.0 dTime=2.0 chunkSize=8KB cSpeed=0MB)
- Go to the lzbench source code path and check the algorithm library used by the test tool.
- Test the compression bandwidth.
- Set the environment variable LD_LIBRARY_PATH and enable the LZ4 library.
1export LD_LIBRARY_PATH=/usr/local/kaelz4/lib:$LD_LIBRARY_PATH
- Compile the bandwidth test tool in the /KAE/KAELz4/test/perftest directory.
1 2
cd KAE/KAELz4/test/perftest make
- Test the compression bandwidth of the LZ4 library.
1./kaelz4_perf -m 80 -b 32 -l 640000
Command output:1 2 3
kaelz4 perf parameter: multi process 64, stream length: 640000(KB), block size: 32(KB), compress level: 1, compress function: 0, loop times: 1, g_threadnum: 15, core sequence: 0 ~ 63 kaelz4 compress perf result: time used: 82891615 us, speed = 7.069 GB/s
- Set the environment variable LD_LIBRARY_PATH and enable the LZ4 library.
Parent topic: Testing the KAELz4 Library