Skip to content

Commit

Permalink
fix table in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ianic committed Feb 7, 2024
1 parent 4a23294 commit 9189294
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
11 changes: 5 additions & 6 deletions bench.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ def size_from_file(fn)
}
end


pp data

# pp data

print "| level | time [ms] | std [ms] | time/std |\n"
print "| :--- | ---: | ---: | ---: |\n"
Expand All @@ -52,12 +50,13 @@ def size_from_file(fn)
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"
end
print "\n"
7 changes: 3 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ 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 |
| :--- | ---: | ---: | ---: |
Expand All @@ -180,15 +181,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 |
| :--- | ---: | ---: | ---: |
| 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 |

0 comments on commit 9189294

Please sign in to comment.