From 622bf9130204d6e4ba62378138b56e52ce43e59a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Anic=CC=81?= Date: Wed, 7 Feb 2024 16:26:22 +0100 Subject: [PATCH] fix table in readme --- bench.rb | 15 +++++++-------- readme.md | 27 ++++++++++++++------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/bench.rb b/bench.rb index 5fe5314..112f8e7 100644 --- a/bench.rb +++ b/bench.rb @@ -41,23 +41,22 @@ def size_from_file(fn) } end - -pp data - +# pp data print "| level | time [ms] | std [ms] | time/std |\n" -print "| :--- | ---: | ---: | ---: |\n" +print "| :--- | ---: | ---: | ---: |\n" data.each do |d| std = d[:std][:mean] lib = d[:lib][:mean] print "|#{d[:level]} | #{'%.2f' % lib} | #{'%.2f' % std} | #{(std/lib).round( 2)} |\n" end +print "\n" - -print "| level | size | std [ms] | sizs/std |\n" -print "| :--- | ---: | ---: | ---: |\n" +print "| level | size | std size | diff | size/std |\n" +print "| :--- | ---: | ---: | ---: | ---: |\n" data.each do |d| std = d[:std][:size] lib = d[:lib][:size] - print "| #{d[:level]} | #{lib} #{std} | #{(std-lib)} | #{'%.4f' % (std.to_f/lib.to_f)} | \n" + print "| #{d[:level]} | #{lib} | #{std} | #{(std-lib)} | #{'%.4f' % (std.to_f/lib.to_f)} | \n" end +print "\n" diff --git a/readme.md b/readme.md index 6d7c6c9..90acfbd 100644 --- a/readme.md +++ b/readme.md @@ -169,9 +169,12 @@ bytes: 24370812 [Go compression levels](https://github.com/ziglang/zig/blob/993a83081a975464d1201597cf6f4cb7f6735284/lib/std/compress/deflate/compressor.zig#L78) -Timing compression's with std lib implementation + + + + | level | time [ms] | std [ms] | time/std | -| :--- | ---: | ---: | ---: | +| :--- | ---: | ---: | ---: | |0 | 472.83 | 543.02 | 1.15 | |4 | 1019.52 | 1222.02 | 1.2 | |5 | 1401.85 | 1673.52 | 1.19 | @@ -180,15 +183,13 @@ Timing compression's with std lib implementation |8 | 4491.72 | 5118.71 | 1.14 | |9 | 6713.99 | 8243.63 | 1.23 | - -Size compression's with std lib implementation -| level | size | std [ms] | sizs/std | -| :--- | ---: | ---: | ---: | -| 0 | 108398793 108397986 | -807 | 1.0000 | -| 4 | 26610575 26557083 | -53492 | 0.9980 | -| 5 | 25231037 25212703 | -18334 | 0.9993 | -| 6 | 24716324 24716123 | -201 | 1.0000 | -| 7 | 24572126 24562137 | -9989 | 0.9996 | -| 8 | 24419542 24425085 | 5543 | 1.0002 | -| 9 | 24370948 24389533 | 18585 | 1.0008 | +| level | size | std size | diff | size/std | +| :--- | ---: | ---: | ---: | ---: | +| 0 | 108398793 | 108397986 | -807 | 1.0000 | +| 4 | 26610575 | 26557083 | -53492 | 0.9980 | +| 5 | 25231037 | 25212703 | -18334 | 0.9993 | +| 6 | 24716324 | 24716123 | -201 | 1.0000 | +| 7 | 24572126 | 24562137 | -9989 | 0.9996 | +| 8 | 24419542 | 24425085 | 5543 | 1.0002 | +| 9 | 24370948 | 24389533 | 18585 | 1.0008 |