Rate This Document
Findability
Accuracy
Completeness
Readability

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 procedure in the source code directory. If KAE is installed using RPM or DEB packages, download and decompress the KAE source package before the test.

  1. Install KAEZlib. For details, see Software Installation (KAE 2.0) or Software Installation (KAE 1.0).
  2. Go to the test directory.
    • KAE 1.0:
      1
      cd kae_zip_engine/test/
      
    • KAE 2.0:
      1
      cd KAEZlib/test/gtest/
      
  3. Test the KAEZlib library functions. (This step is applicable only to KAE 2.0. You can skip this step is KAE 1.0 is used because its functional test and performance test procedures are the same.)
    1
    2
    sh build.sh
    ./kaezlibtest --gtest_filter=*Case*
    

    In the command output, if the execution results of both SmallCase and LargeCase are passed, the KAEZlib library functions are normal.

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    [==========] Running 2 tests from 1 test suite.
    [----------] Global test environment set-up.
    [----------] 2 tests from ZlibTest
    [ RUN      ] ZlibTest.CompressAndDecompress_SmallCase
    [       OK ] ZlibTest.CompressAndDecompress_SmallCase (116 ms)
    [ RUN      ] ZlibTest.CompressAndDecompress_LargeCase
    [       OK ] ZlibTest.CompressAndDecompress_LargeCase (89915 ms)
    [----------] 2 tests from ZlibTest (90031 ms total)
    
    [----------] Global test environment tear-down
    [==========] 2 tests from 1 test suite ran. (90031 ms total)
    [  PASSED  ] 2 tests.
    
  4. Test the performance.
    1. Go to the performance test directory.
      • KAE 1.0:
        1
        cd kae_zip_engine/test
        
      • KAE 2.0:
        1
        cd KAEZlib/test/perftest
        
    2. Compile the performance test tool.
      1
      make
      
    3. Generate an input file for the decompression performance test.
      1
      ./zip_perf -f ../../../scripts/compressTestDataset/itemdata -o itemdata.zlib -m 1 -n 1
      
    4. Test the compression performance.
      • Testing the compression performance of ZIP
        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 10488786B = 10.003MB, compress_rate is 100.029%
        compress_size is 10488786B = 10.003MB, compress_rate is 100.029%
        compress_size is 10488786B = 10.003MB, compress_rate is 100.029%
        compress_size is 10488786B = 10.003MB, compress_rate is 100.029%
        compress_size is 10488786B = 10.003MB, compress_rate is 100.029%
        compress_size is 10488786B = 10.003MB, compress_rate is 100.029%
        compress_size is 10488786B = 10.003MB, compress_rate is 100.029%
        compress_size is 10488786B = 10.003MB, compress_rate is 100.029%
        kaezip compress perf result:
             time used: 256539951 us, speed = 0.305 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.305 GB/s to 7.348 GB/s.

    5. Test the decompression performance.
      • Testing the decompression performance of ZIP
        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.

  5. Optional: If the KAEGzip tool is installed, perform the following operations to verify its functions and performance:
    1. Obtain help information.
      1
      /usr/local/kaegzip/gzip -h
      
    2. Test its functions.
      1. Use KAEGzip to compress the itemdata file into itemdata.gz while retaining the original file itemdata.
        1
        /usr/local/kaegzip/gzip -k itemdata
        
      2. Rename the source file itemdata to itemdata.orig.
        1
        mv itemdata itemdata.orig
        
      3. Use KAEGzip to decompress the itemdata.gz file.
        1
        /usr/local/kaegzip/gzip -d itemdata.gz 
        
      4. Compare the file generated after decompression with the original file itemdata.orig.
        1
        diff itemdata itemdata.orig 
        

      If no command output is displayed, KAEGzip has correctly compressed and decompressed the file.

    3. Test the compression performance.
      • Using gzip
        time gzip itemdata
        Command output:
        real	0m0.348s
        user	0m0.343s
        sys	0m0.004s
      • Using KAEGzip
        time /usr/local/kaegzip/gzip itemdata

        Command output:

        real	0m0.016s
        user	0m0.005s
        sys	0m0.010s

      Compared with the built-in gzip tool, the compression time using KAEGzip is significantly reduced.

    4. Test the decompression performance.
      • Using gzip
        time gzip -d itemdata.gz 

        Command output:

        real	0m0.038s
        user	0m0.031s
        sys	0m0.008s
      • Using KAEGzip
        time /usr/local/kaegzip/gzip -d itemdata.gz 
      • Command output:
        real	0m0.017s
        user	0m0.004s
        sys	0m0.012s

      Compared with the built-in gzip tool, the decompression time using KAEGzip is significantly reduced.