Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve performance for small inputs #2

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

gkowal
Copy link

@gkowal gkowal commented Jul 6, 2020

By reusing the buffer the small input performance improves dramatically.

The example output on my machine:

BenchmarkFastCDCSize/1k                  5203628               228 ns/op        4492.41 MB/s             1.00 chunks           1 B/op          0 allocs/op
BenchmarkFastCDCSize/4k                  1750215               686 ns/op        5974.14 MB/s             1.00 chunks           4 B/op          0 allocs/op
BenchmarkFastCDCSize/16k                  455090              2488 ns/op        6584.83 MB/s             1.00 chunks          18 B/op          0 allocs/op
BenchmarkFastCDCSize/32k                  238017              4860 ns/op        6741.91 MB/s             1.00 chunks          35 B/op          0 allocs/op
BenchmarkFastCDCSize/64k                  122582              9601 ns/op        6825.77 MB/s             1.00 chunks          68 B/op          0 allocs/op
BenchmarkFastCDCSize/128k                  61484             19401 ns/op        6755.81 MB/s             1.00 chunks         136 B/op          0 allocs/op
BenchmarkFastCDCSize/256k                  30966             38856 ns/op        6746.52 MB/s             1.00 chunks         270 B/op          0 allocs/op
BenchmarkFastCDCSize/512k                   2385            483351 ns/op        1084.69 MB/s             1.00 chunks        3517 B/op          0 allocs/op
BenchmarkFastCDCSize/1M                      786           1493472 ns/op         702.11 MB/s             1.00 chunks       10672 B/op          0 allocs/op
BenchmarkFastCDCSize/4M                      172           6929246 ns/op         605.30 MB/s             4.00 chunks       48771 B/op          0 allocs/op
BenchmarkFastCDCSize/16M                      43          25280504 ns/op         663.64 MB/s            15.0 chunks       195086 B/op          0 allocs/op
BenchmarkFastCDCSize/32M                      21          51466408 ns/op         651.97 MB/s            28.0 chunks       399462 B/op          0 allocs/op
BenchmarkFastCDCSize/64M                      10         104412456 ns/op         642.73 MB/s            56.0 chunks       838872 B/op          0 allocs/op
BenchmarkFastCDCSize/128M                      5         207613783 ns/op         646.48 MB/s           116 chunks        1677744 B/op          0 allocs/op
BenchmarkFastCDCSize/512M                      2         839211188 ns/op         639.73 MB/s           454 chunks        4194360 B/op          1 allocs/op
BenchmarkFastCDCSize/1G                        1        1727176911 ns/op         621.67 MB/s           902 chunks        8388720 B/op          2 allocs/op

This PR includes also PR #1, therefore the previous one can be ignored.

gkowal added 2 commits July 6, 2020 09:54
New method NewReader() can be used to change the input data.

Signed-off-by: Grzegorz Kowal <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Jul 6, 2020

Codecov Report

Merging #2 into master will increase coverage by 0.28%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master       #2      +/-   ##
==========================================
+ Coverage   95.83%   96.11%   +0.28%     
==========================================
  Files           1        1              
  Lines          96      103       +7     
==========================================
+ Hits           92       99       +7     
  Misses          2        2              
  Partials        2        2              
Impacted Files Coverage Δ
fastcdc.go 96.11% <100.00%> (+0.28%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f27242f...3cac44c. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants