ozip now has a benchmarking option (ozip -b) which is an easy way to test Oodle.
ozip -b runs encode & decode many times to provide accurate timing. It does not include IO. It was designed to be similar to zstd -b so that they are directly comparable.
ozip -b can take a file or a dir (plus wildcard), in which case it will test all the files in the dir. You can set up the specific compressor and options you want to test to see how they affect performance and compression ratio.
So for example you can test the effect of spaceSpeedTradeoffBytes on Kraken level Optimal1 :
r:\>ozip -b -c8 -z5 r:\testsets\silesia\mozilla -os512
K 5 mozilla : 51220480 -> 14288373 (3.585), 3.5 MB/s, 1080.4 MB/s
r:\>ozip -b -c8 -z5 r:\testsets\silesia\mozilla
K 5 mozilla : 51220480 -> 14216948 (3.603), 3.5 MB/s, 1048.6 MB/s
r:\>ozip -b -c8 -z5 r:\testsets\silesia\mozilla -os128
K 5 mozilla : 51220480 -> 14164777 (3.616), 3.5 MB/s, 1004.6 MB/s
Or to test Kraken HyperFast3 on all the files in Silesia :
r:\>ozip -b -c8 -ol-3 r:\testsets\silesia\*
K-3 12 files : 211938580 -> 81913142 (2.587), 339.0 MB/s, 1087.6 MB/s
Another option for easy testing with Oodle is example_lz_chart, which is also provided as a pre-compiled exe and also as source code.
example_lz_chart runs on a single file you provide and prints a report of the compression ratio and speed of various Oodle compressors and encode levels.
This gives you an overview of the different performance points you can hit with Oodle.
WARNING :
Do not try to profile Oodle by process timing ozip.
The normal ozip (not -b mode) uses stdio and is not designed to be as efficient as possible. It's designed for simplicity and to replicated gzip behavior when used for streaming pipes on UNIX.
In general it is not recommended to benchmark by timing with things like IO included because it's very difficult to do that right and can give misleading results.
See also :
Tips for benchmarking a compressor
The Perils of Holistic Profiling
Tips for using Oodle as Efficiently as Possible
NOTE :
ozip does not have any threading. ozip -b is benchmarking single threaded performance.
This is true even for the new Jobify threading because ozip initializes OodleX without threads :
OodleX_Init_Default(OODLE_HEADER_VERSION,OodleX_Init_GetDefaults_DebugSystems_No,OodleX_Init_GetDefaults_Threads_No);
I believe that zstd -b is also single threaded so they are apples to apples. However some compressors uses threads by default (LZMA, LZHAM, etc.) so if they are being compared they should be set to not use threads OR you should use Oodle with threads. Measuring multi-threaded performance is context dependent (for example are you encoding many small chunks simultaneously?) and I generally don't recommend it, it's much easier to compare fairly with single threaded performance.
For high performance on large files, ask for the "oozi" example.
No comments:
Post a Comment