powturbo / TurboBench

Compression Benchmark
323 stars 33 forks source link

TurboBench claims to have tons of codecs, but I only see a few #33

Closed pps83 closed 1 year ago

pps83 commented 1 year ago

Unlike lzbench, TurboBench is quite useless. Doesn't have an easy way to test all possible codecs to see which one compresses best or decompresses faster.

It absolutely HAS TO HAVE -eall mode like lzbench. I absolutely wasn't able to even test lzturbo.

nmoinvaz commented 1 year ago

Have you downloaded the submodules using the command

git submodule update --init
pps83 commented 1 year ago

regardless if I downloaded, there is no such option to run all codecs similar to lzbench's -eall to run all available codecs. Also, it seems that there is no way to list available coders. I checked my src three, and it seems that all submodules are checked out.

powturbo commented 1 year ago

Turbobench is superior to lzbench, support more codecs, more features, better precision, submodule architecture with instant update, c/d memory usage (linux only), specific codec parameters (see lzma), colored screen output with pareto display, several output formats like html... There is no -eall option because it will be too slow and the output will be too long and confusing. You can instead define your own codec groups the turbobench.ini. You can list all included codecs with the options "-l1" and "-l2". This is all described in the help display.

powturbo commented 1 year ago

You can download executables for windows under releases

milahu commented 1 year ago

an easy way to test all possible codecs

wrapper script:

turbobench_all.sh ```sh #! /usr/bin/env bash # turbobench_all.sh # run turbobench with all codecs and all compression levels # example use: # turbobench_all.sh testfile.tar # turbobench_all.sh testfile.tar --max-levels --min-speed 20000 -v2 # license: public domain, zero warranty # todo: rewrite in python # todo: accept custom score formula (weighted sort): example sort by compressed_size and decompress_speed and rss_max # postprocessing the tbb file: # # f=unpacked-zips-1mb.tar.tbb; (head -n1 $f; cat $f | tail -n+2 | sort -n -k3) | awk '{ ratio=($3*100/($2+0.0000001)); if ($6 == "memcpy" || ($4 < 0.1 && ratio < 35)) printf("%-10s %10s %s,%s\n",ratio,$4,$6,$7) }' | grep -v ' 0.000000 ' # -> sort by size (sort -k3), filter by size (ratio < 35), filter by decompression time ($4 < 0.1) # # f=unpacked-zips-10mb.tar.tbb; results_dir=$(md5sum ${f%.*} | awk '{print $1}'); (head -n1 $f; cat $f | tail -n+2 | sort -n -k3) | awk '{ ratio=($3*100/($2+0.0000001)); if ($6 == "memcpy" || ($4 < 1 && ratio < 35)) printf("%-10s %10s %10s %10s %s,%s\n",ratio,$4,$10,$12,$6,$7) }' | grep -v ' 0.000000 ' | while read line; do codec=$(echo $line | awk '{ print $5 }'); time_output=$(cat $results_dir/$codec.txt); rss_max=$(echo "$time_output" | grep 'Maximum resident set size' | awk '{print $6}'); printf "%10s %s\n" $rss_max "$line"; done # -> sort (as above) and show rss_max in first column set -eu # debug function find_command() { result=$(which $1 2>/dev/null) if [ -z "$result" ]; then echo "error: not found command $1" >&2 exit 1 fi echo "$result" } turbobench=$(find_command turbobench) # debug #turbobench=/nix/store/331vpidf0n7pdq47x3pk2dswywblfxvk-turbobench-2023-03/bin/turbobench time=$(find_command time) # TODO require "time -v" find_command bc >/dev/null function show_help() { echo "usage:" >&2 echo "turbobench_all.sh file_to_compress [option...]" >&2 echo "" >&2 echo "" >&2 echo "" >&2 echo "turbobench_all options:" >&2 echo "" >&2 echo "--default-levels use default compression levels" >&2 echo "--min-levels use lowest compression levels" >&2 echo "--avg-levels use average compression levels" >&2 echo "--max-levels use highest compression levels" >&2 echo "--all-levels use all compression levels" >&2 echo "" >&2 echo "--min-speed SPEED filter codecs by compression speed in bytes/second. default: 0. example: 20000" >&2 echo "--max-time TIME filter codecs by compression time in seconds. default: inf. example: 60" >&2 echo "--faster-than CODEC select codecs with benchmark faster than a reference codec. example: brotli,11" >&2 echo "" >&2 echo "--codecs CODECS space-separated list of codecs. default: all codecs. example: \"brotli zstd libdeflate lzham gzip bzip2 zlib lzma lz4 memcpy\"" >&2 echo "--list-codecs list all codecs" >&2 echo "" >&2 echo "--ignore-cache ignore cached results in tbb file" >&2 echo "" >&2 echo "" >&2 echo "" >&2 echo "turbobench options:" >&2 echo "" >&2 $turbobench -h 2>&1 | tail -n+3 >&2 } if [ $# = 0 ]; then show_help exit 1 fi # parse arguments file_to_compress="" #levels="default" # TODO define default compression levels #levels="all" # FIXME buffer overflow levels="avg" min_speed="" # brotli 11: 0.04 MB/s -> 41943 bytes/second max_time="" faster_than="" codecs="" ignore_cache=false raw_args=("--" "$@") args=() for ((idx=1; idx<${#raw_args[@]}; idx++)); do arg="${raw_args[$idx]}" #echo "arg $idx: '$arg'" case $arg in --default-levels) levels="default" ;; --min-levels) levels="min" ;; --avg-levels) levels="avg" ;; --max-levels) levels="max" ;; --all-levels) levels="all" ;; --ignore-cache) ignore_cache=true ;; --min-speed) : $((idx++)) min_speed="${raw_args[$idx]}" ;; --max-time) : $((idx++)) max_time="${raw_args[$idx]}" ;; --faster-than) : $((idx++)) faster_than="${raw_args[$idx]}" ;; --codecs) : $((idx++)) codecs="${raw_args[$idx]}" ;; --list-codecs) $turbobench -l1 | tail -n+3 | while read c r; do echo $c; done exit ;; -h|--help) # tail: remove "invalid option -- 'h'" show_help exit 1 ;; -*) # passthru arg to turbobench args+=("$arg") ;; *) # passthru arg to turbobench args+=("$arg") file_to_compress="$arg" ;; esac done tbb_file="$file_to_compress.tbb" done_codecs="" if [ -e "$tbb_file" ]; then done_codecs=$(cat "$tbb_file" | tail -n+2 | cut -d$'\t' -f6,7 | tr '\t' , | tr '\n' ' ') fi # debug: print config echo "file_to_compress: $file_to_compress" echo "tbb_file: $tbb_file" echo "done_codecs: $done_codecs" echo "levels: $levels" echo "min_speed: $min_speed" echo "max_time: $max_time" echo "codecs: ${codecs:-all}" echo "turbobench args:" printf " %s\n" "${args[@]}" if ! [ -e "$file_to_compress" ]; then echo "error: no such file: $file_to_compress" >&2 exit 1 fi if [ -n "$min_speed" ] && [ -n "$max_time" ] && [ -n "$faster_than" ]; then echo "error: you can set only one option of: min-speed, max-time, faster-than" >&2 exit 1 fi file_to_compress_md5=$(md5sum "$file_to_compress") file_to_compress_md5="${file_to_compress_md5:0:32}" echo "file_to_compress md5: $file_to_compress_md5" file_to_compress_size=$(stat -c%s "$file_to_compress") echo "file_to_compress size: $file_to_compress_size" results_dir=$file_to_compress_md5 echo "writing result files to ./$results_dir/" mkdir -p $results_dir if [ -n "$min_speed" ] && [ "$min_speed" != 0 ]; then max_time=$(( file_to_compress_size / min_speed )) echo "max_time: $file_to_compress_size / $min_speed = $max_time" fi if [ -n "$faster_than" ]; then tbb_line="" if [ -e "$tbb_file" ]; then faster_than_tsv=$(echo $faster_than | tr '[:space:],' '\t') tbb_line=$(grep -P "\t$faster_than_tsv\t" "$tbb_file") fi if [ -n "$tbb_line" ]; then read _ _ _ dtime ctime _ <<<"$tbb_line" max_time=$(echo "$dtime + $ctime" | bc) echo "max_time: tbb file $faster_than -> $max_time" else echo "max_time: turbobench -e$faster_than ..." t1=$(date +%s) # -g: dont update the tbb file $turbobench -e"$faster_than" -g "$file_to_compress" t2=$(date +%s) max_time=$((t2 - t1)) echo "max_time: turbobench -e$faster_than -> $max_time" fi fi if [ -z "$max_time" ]; then max_time=inf fi # TODO define default compression levels # todo: fix in turbobench. should use default compression level by default declare -A default_level # use highest compression level by default # turbobench -l1 | tail -n+3 | while read a b; do [ -z "$b" ] && continue; L=${b%%/*}; L=${L##*,}; echo "default_level[$a]=$L # $b"; done default_level[brotli]=11 # 0,1,2,3,4,5,6,7,8,9,10,11/d#:V default_level[fastlz]=2 # 1,2 default_level[flzma2]=11 # 0,1,2,3,4,5,6,7,8,9,10,11/mt# default_level[bsc]=8 # 0,3,4,5,6,7,8/p:e# default_level[bscqlfc]=2 # 1,2 default_level[libdeflate]=12 # 1,2,3,4,5,6,7,8,9,12/dg default_level[zpaq]=5 # 0,1,2,3,4,5 default_level[lz4]=16 # 0,1,9,10,11,12,16/MfsB# default_level[lzham]=4 # 1,2,3,4/t#:fb#:x# default_level[lzlib]=9 # 1,2,3,4,5,6,7,8,9/d#:fb# default_level[lzma]=9 # 0,1,2,3,4,5,6,7,8,9/d#:fb#:lp#:lc#:pb#:a#:mt# default_level[lzo1b]=999 # 1,9,99,999 default_level[lzo1c]=999 # 1,9,99,999 default_level[lzo1f]=999 # 1,999 default_level[lzo1x]=999 # 1,11,12,15,999 default_level[lzo1y]=999 # 1,999 default_level[lzo1z]=999 # 999 default_level[lzo2a]=999 # 999 default_level[lzsa]=9 # 9/f#cr default_level[quicklz]=3 # 1,2,3 default_level[zlib]=9 # 1,2,3,4,5,6,7,8,9 default_level[zstd]=-22 # 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,-1,-2,-3,-4,-5,-6,-7,-8,-9,-10,-11,-12,-13,-14,-15,-16,-17,-18,-19,-20,-21,-22/d# default_level[oodle]=139 # 01,02,03,04,05,06,07,08,09,11,12,13,14,15,16,17,18,19,21,22,23,24,25,26,27,28,29,41,42,43,44,45,46,47,48,49,51,52,53,54,55,56,57,58,59,61,62,63,64,65,66,67,68,69,71,72,73,74,75,76,77,78,79,81,82,83,84,85,86,87,88,89,-81,-82,-83,91,92,93,94,95,96,97,98,99,-91,-92,-93,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,-111,-112,-113,121,122,123,124,125,126,127,128,129,131,132,133,134,135,136,137,138,139 default_level[TurboRC]=90 # 1,2,3,4,9,10,12,14,17,20,21,90/e# default_level[zlibh]=32 # 8,9,10,11,12,13,14,15,16,32 default_level[srle]=64 # 0,8,16,32,64 default_level[st]=8 # 3,4,5,6,7,8 # select compression levels all_codecs_raw=$($turbobench -l1 | tail -n+3) e_options="" num_e_options=0 while read codec rest; do if [ -n "$codecs" ] && [[ " $codecs " != *" $codec "* ]]; then continue fi if [ "$rest" = "" ]; then e_options+="$codec"$'\n' : $((num_e_options++)) continue fi if [ $levels = "default" ]; then level=${default_level[$codec]} e_options+="$codec,$level"$'\n' : $((num_e_options++)) continue fi codec_levels=${rest%%/*} if [ $levels = "all" ]; then #e_options+="$codec,$codec_levels"$'\n' # group levels #e_options+="$codec" # group levels while read -d, level; do # workaround: level '1' for codec 'oodle' not in range #if [[ $level = 0[0-9]* ]]; then echo "skip: $codec,$level"; continue; fi #e_options+=",$level" # group levels e_options+="$codec,$level"$'\n' : $((num_e_options++)) done <<<"${codec_levels}," #e_options+=$'\n' # group levels continue fi if [ $levels = "min" ]; then level=${codec_levels%%,*} e_options+="$codec,$level"$'\n' : $((num_e_options++)) continue fi if [ $levels = "avg" ]; then #[ $codec = zstd ] && printf "%s\n" "${codec_levels_array[@]}" # sort array. zstd has negative compression levels: 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,-1,-2,-3,-4,-5,-6,-7,-8,-9,-10,-11,-12,-13,-14,-15,-16,-17,-18,-19,-20,-21,-22 # todo: fix in turbobench. negative compression levels should be listed first codec_levels_array=() while read level; do codec_levels_array+=($level) done < <(echo "${codec_levels}" | tr , '\n' | sort -n) len=${#codec_levels_array[@]} #idx=$(((len + 1) / 2)) # +1: round up. no, this breaks on len == 1 idx=$((len / 2)) level=${codec_levels_array[$idx]} #echo "$codec: using level $idx of $len = level $level of codec_levels = $codec_levels" e_options+="$codec,$level"$'\n' : $((num_e_options++)) continue fi if [ $levels = "max" ]; then level=${codec_levels##*,} e_options+="$codec,$level"$'\n' : $((num_e_options++)) continue fi done <<<"$all_codecs_raw" echo "num_e_options: $num_e_options" # loop e_options for e_option in $e_options; do results_file="$results_dir/$e_option.txt" if false && [ -e "$results_file" ]; then echo "skipping $e_option because output exists: $results_file" continue fi if ! $ignore_cache && [[ " $done_codecs " = *" $e_option "* ]]; then echo "skipping $e_option because existing result in tbb file" continue fi tbb_file_bak="" if [ -e "$tbb_file" ]; then tbb_file_bak="$file_to_compress.tbb.$(date +%s).bak" cp "$tbb_file" "$tbb_file_bak" fi echo writing $results_file set -e # exit on error or keyboard interrupt echo \ $turbobench -e$e_option "${args[@]}" timeout_cmd=() if [ "$max_time" != "inf" ]; then timeout_cmd=(timeout --verbose --signal=KILL $max_time) fi "${timeout_cmd[@]}" \ $time -v \ $turbobench -e$e_option "${args[@]}" 2>&1 | tee "$results_file.tmp" status=$? set +e echo "status: $status" if [ $status = 0 ]; then mv "$results_file.tmp" "$results_file" elif [ $status = 124 ]; then echo timeout >"$results_file" else echo "status: $status" >"$results_file" fi if [ -n "$tbb_file_bak" ]; then tbb_size_1=$(stat -c%s "$tbb_file_bak") tbb_size_2=$(stat -c%s "$tbb_file") if (( tbb_size_2 < tbb_size_1 )); then # new tbb file is smaller # because of a bug in turbobench # -> restore the old file echo "new tbb file is smaller. restoring the old tbb file" mv "$tbb_file_bak" "$tbb_file" else rm "$tbb_file_bak" fi fi # TODO parse output of "time -v" # total_time: Elapsed (wall clock) time (h:mm:ss or m:ss): 0:06.17 # load_avg: Percent of CPU this job got: 98% # rss_max: Maximum resident set size (kbytes): 20164 # rss_max_rel: rss_max / uncompressed_size # switch_vol: Voluntary context switches: 1 # switch_invol: Involuntary context switches: 2431 # fixme: "bsc 7" and "bsc 8": infinite score should be printed as "inf" not as "167423219872854250310480057943336997924438274955232624522333477440436613541123027690304032184897808517832736441413296818951444073477260938629943455293343883926095357701695786860068785110851124808262911167419640293628520552910140667265102788183953006076438190605626183719130397942773345747264478380032.00" # fixme: all "zpaq" are wrong: 9628390 887.0 inf inf 9.63 zpaq 5 unpacked-zips-1mb.tar # fixme: "lzo1f 1": ERROR at 0:75, 8a file=unpacked-zips-1mb.tar # Command terminated by signal 11 # tbb file is empty # -> backup tbb file before each run # todo: catch keyboard interrupt, remove partial result file # better: write to temp file, then move temp file to result file # todo: add option timeout. kill all compressors slower than X # better: option min-speed done ```

I absolutely wasn't able to even test lzturbo.

lzturbo is closed source

powturbo commented 1 year ago

Thank you for the script. You can also define those entries in turbobench.ini file. lzturbo is actually not included in turbobench.exe

milahu commented 1 year ago

updated my script

problem: when i select all compression levels, turbobench crashes

$ ./turbobench_all.sh test.tar --all-levels
levels: all
codecs: 
+ turbobench -ebrotli,0/brotli,1/brotli,2/brotli,3/brotli,4/brotli,5/brotli,6/brotli,7/brotli,8/brotli,9/brotli,10/brotli,11/bzip2/bzip3/fastlz,1/fastlz,2/flzma2,0/flzma2,1/flzma2,2/flzma2,3/flzma2,4/flzma2,5/flzma2,6/flzma2,7/flzma2,8/flzma2,9/flzma2,10/flzma2,11/bsc,0/bsc,3/bsc,4/bsc,5/bsc,6/bsc,7/bsc,8/bscqlfc,1/bscqlfc,2/libdeflate,1/libdeflate,2/libdeflate,3/libdeflate,4/libdeflate,5/libdeflate,6/libdeflate,7/libdeflate,8/libdeflate,9/libdeflate,12/zpaq,0/zpaq,1/zpaq,2/zpaq,3/zpaq,4/zpaq,5/lz4,0/lz4,1/lz4,9/lz4,10/lz4,11/lz4,12/lz4,16/lzfse/lzham,1/lzham,2/lzham,3/lzham,4/lzlib,1/lzlib,2/lzlib,3/lzlib,4/lzlib,5/lzlib,6/lzlib,7/lzlib,8/lzlib,9/lzma,0/lzma,1/lzma,2/lzma,3/lzma,4/lzma,5/lzma,6/lzma,7/lzma,8/lzma,9/lzo1b,1/lzo1b,9/lzo1b,99/lzo1b,999/lzo1c,1/lzo1c,9/lzo1c,99/lzo1c,999/lzo1f,1/lzo1f,999/lzo1x,1/lzo1x,11/lzo1x,12/lzo1x,15/lzo1x,999/lzo1y,1/lzo1y,999/lzo1z,999/lzo2a,999/lzsa,9/quicklz,1/quicklz,2/quicklz,3/zlib,1/zlib,2/zlib,3/zlib,4/zlib,5/zlib,6/zlib,7/zlib,8/zlib,9/zopfli/zstd,1/zstd,2/zstd,3/zstd,4/zstd,5/zstd,6/zstd,7/zstd,8/zstd,9/zstd,10/zstd,11/zstd,12/zstd,13/zstd,14/zstd,15/zstd,16/zstd,17/zstd,18/zstd,19/zstd,20/zstd,21/zstd,22/zstd,-1/zstd,-2/zstd,-3/zstd,-4/zstd,-5/zstd,-6/zstd,-7/zstd,-8/zstd,-9/zstd,-10/zstd,-11/zstd,-12/zstd,-13/zstd,-14/zstd,-15/zstd,-16/zstd,-17/zstd,-18/zstd,-19/zstd,-20/zstd,-21/zstd,-22/imemcpy/memcpy/oodle,01/oodle,02/oodle,03/oodle,04/oodle,05/oodle,06/oodle,07/oodle,08/oodle,09/oodle,11/oodle,12/oodle,13/oodle,14/oodle,15/oodle,16/oodle,17/oodle,18/oodle,19/oodle,21/oodle,22/oodle,23/oodle,24/oodle,25/oodle,26/oodle,27/oodle,28/oodle,29/oodle,41/oodle,42/oodle,43/oodle,44/oodle,45/oodle,46/oodle,47/oodle,48/oodle,49/oodle,51/oodle,52/oodle,53/oodle,54/oodle,55/oodle,56/oodle,57/oodle,58/oodle,59/oodle,61/oodle,62/oodle,63/oodle,64/oodle,65/oodle,66/oodle,67/oodle,68/oodle,69/oodle,71/oodle,72/oodle,73/oodle,74/oodle,75/oodle,76/oodle,77/oodle,78/oodle,79/oodle,81/oodle,82/oodle,83/oodle,84/oodle,85/oodle,86/oodle,87/oodle,88/oodle,89/oodle,-81/oodle,-82/oodle,-83/oodle,91/oodle,92/oodle,93/oodle,94/oodle,95/oodle,96/oodle,97/oodle,98/oodle,99/oodle,-91/oodle,-92/oodle,-93/oodle,101/oodle,102/oodle,103/oodle,104/oodle,105/oodle,106/oodle,107/oodle,108/oodle,109/oodle,111/oodle,112/oodle,113/oodle,114/oodle,115/oodle,116/oodle,117/oodle,118/oodle,119/oodle,-111/oodle,-112/oodle,-113/oodle,121/oodle,122/oodle,123/oodle,124/oodle,125/oodle,126/oodle,127/oodle,128/oodle,129/oodle,131/oodle,132/oodle,133/oodle,134/oodle,135/oodle,136/oodle,137/oodle,138/oodle,139/TurboRC,1/TurboRC,2/TurboRC,3/TurboRC,4/TurboRC,9/TurboRC,10/TurboRC,12/TurboRC,14/TurboRC,17/TurboRC,20/TurboRC,21/TurboRC,90/zlibh,8/zlibh,9/zlibh,10/zlibh,11/zlibh,12/zlibh,13/zlibh,14/zlibh,15/zlibh,16/zlibh,32/zlibrle/srle,0/srle,8/srle,16/srle,32/srle,64/trle/bscbwt/st,3/st,4/st,5/st,6/st,7/st,8 test.tar
*** buffer overflow detected ***: terminated
Aborted (core dumped)

when i build turbobench with gcc -O0 then i get the error

level '1' for codec 'oodle' not in range [01,02,03,04,05,06,07,08,09,11,12,13,14,15,16,17,18,19,21,22,23,24,25,26,27,28,29,41,42,43,44,45,46,47,48,49,51,52,53,54,55,56,57,58,59,61,62,63,64,65,66,67,68,69,71,72,73,74,75,76,77,78,79,81,82,83,84,85,86,87,88,89,-81,-82,-83,91,92,93,94,95,96,97,98,99,-91,-92,-93,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,-111,-112,-113,121,122,123,124,125,126,127,128,129,131,132,133,134,135,136,137,138,139]
powturbo commented 1 year ago

Probably the maximum arg length is exceeded. You can group all levels into a single entry. ex. brotli,1,2,3,4,5,6,7,8,9,10,11 instead of brotli,1/brotli,2....

For oodle use the levels: 81-89 for kraken (88 is max.?) 91-99 for memaid 111-119: for selkie 131-139: for leviathan other levels are not in latest oodle library 9.

levels are strings, use 01 instead of 1.

It's no recommanded to use all levels with many codecs, because it will be TOO slow wih large files.

milahu commented 1 year ago

its a bug. minimal repro:

$ turbobench -eoodle,01
level '1' for codec 'oodle' not in range [01,02,03,04,05,06,07,08,09,11,12,13,14,15,16,17,18,19,21,22,23,24,25,26,27,28,29,41,42,43,44,45,46,47,48,49,51,52,53,54,55,56,57,58,59,61,62,63,64,65,66,67,68,69,71,72,73,74,75,76,77,78,79,81,82,83,84,85,86,87,88,89,-81,-82,-83,91,92,93,94,95,96,97,98,99,-91,-92,-93,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,-111,-112,-113,121,122,123,124,125,126,127,128,129,131,132,133,134,135,136,137,138,139]

fix:

--- a/turbobench.c
+++ b/turbobench.c
@@ -419,6 +419,13 @@ int plugreg(struct plug *plug, char *cmd, int k, int bsize, int bsizex) {

       char *prm = cmd; 
       int lev = strtol(cmd, &cmd, 10); 
+      int lev_str_len = cmd - prm;
+      #define MAX_LEV_STR_LEN 32
+      char lev_str[MAX_LEV_STR_LEN + 1];
+      if (lev_str_len > MAX_LEV_STR_LEN)
+        die("level string is too long");
+      memset(&lev_str, 0, MAX_LEV_STR_LEN + 1);
+      memcpy(&lev_str, prm, lev_str_len);
       if(prm == cmd) { 
         lev = INVLEV; 
         prm = cempty; 
@@ -438,10 +445,9 @@ int plugreg(struct plug *plug, char *cmd, int k, int bsize, int bsizex) {
         break;                              
       for(gs = plugs; gs->id >= 0; gs++)
         if(gs->codec && !strcasecmp(gs->s, name) ) { 
-          char s[33],*q; 
-          sprintf(s,"%d", lev); 
+          char *q; 
           found++; 
-          if(lev==INVLEV && gs->lev && !gs->lev[0] || gs->lev && (q=strstr(gs->lev, s)) && (q==gs->lev || *(q-1) == ',')) {
+          if(lev==INVLEV && gs->lev && !gs->lev[0] || gs->lev && (q=strstr(gs->lev, lev_str)) && (q==gs->lev || *(q-1) == ',')) {
             found++; 
             plugins(plug, gs, &k, bsize, bsizex, lev, prm); 
           }

next error:

$ turbobench -ebrotli,0,1,2,3,4,5,6,7,8,9,10,11/bzip2/bzip3/fastlz,1,2/flzma2,0,1,2,3,4,5,6,7,8,9,10,11/bsc,0,3,4,5,6,7,8/bscqlfc,1,2/libdeflate,1,2,3,4,5,6,7,8,9,12/zpaq,0,1,2,3,4,5/lz4,0,1,9,10,11,12,16/lzfse/lzham,1,2,3,4/lzlib,1,2,3,4,5,6,7,8,9/lzma,0,1,2,3,4,5,6,7,8,9/lzo1b,1,9,99,999/lzo1c,1,9,99,999/lzo1f,1,999/lzo1x,1,11,12,15,999/lzo1y,1,999/lzo1z,999/lzo2a,999/lzsa,9/quicklz,1,2,3/zlib,1,2,3,4,5,6,7,8,9/zopfli/zstd,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,-1,-2,-3,-4,-5,-6,-7,-8,-9,-10,-11,-12,-13,-14,-15,-16,-17,-18,-19,-20,-21,-22/imemcpy/memcpy/fpc,0,8,9,10,11,12,16,32,48,63/vecrc_sh/FastHF/FastAC/oodle,11,12,13,14,15,16,17,18,19,21,22,23,24,25,26,27,28,29,41,42,43,44,45,46,47,48,49,51,52,53,54,55,56,57,58,59,61,62,63,64,65,66,67,68,69,71,72,73,74,75,76,77,78,79,81,82,83,84,85,86,87,88,89,-81,-82,-83,91,92,93,94,95,96,97,98,99,-91,-92,-93,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,-111,-112,-113,121,122,123,124,125,126,127,128,129,131,132,133,134,135,136,137,138,139/subotin/TurboRC,1,2,3,4,9,10,12,14,17,20,21,90/zlibh,8,9,10,11,12,13,14,15,16,32/zlibrle/srle,0,8,16,32,64/trle/bscbwt/st,3,4,5,6,7,8
Too many codecs specified

quickfix: raise PLUGN to 339 (or more)

next error:

oodle shared library './liboo2corelinux64.so.9' not found.'./liboo2corelinux64.so.9: cannot open shared object file: No such file or directory'

quickfix: move OODLE=1 to this section of makefile:

# Archived codecs and other codecs (manual download)

... and maybe explain how to get oodle, see also https://github.com/AlexP0/HZDMeshTool/blob/main/get_liboo2corelinux64.sh

fix: "library not found" should be a warning (not a fatal error)

powturbo commented 1 year ago

If you don't use oodle, then you'll not get a message error. If you specify 300 codecs you must probably wait days before turbobench finish. If a codec crashes then you loose all the results and you must restart turbobench again. Better test in groups like those in turbobench.ini. You don't need any script, just define your codecs in turbobench.ini.

I don't want to spend lot of time fixing corner cases like when too many codecs are specified. This is a benchmark program and not something that will be used in production. Oodle can be obtained by downloading the 22GB UnrealEngine. For windows, just search google with "oo2core_9_win64.dll"