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

Pass tables by pointer in Chunker.slide/updateDigest #28

Merged
merged 1 commit into from
Jun 14, 2020

Conversation

greatroar
Copy link

@greatroar greatroar commented Mar 12, 2020

Passing them by value causes 4kB to be copied on the stack.

This fixes a performance regression introduced in 61d1f12.

name                 old time/op   new time/op   delta
ChunkerWithSHA256-8    205ms ± 0%    205ms ± 0%  -0.20%  (p=0.001 n=10+10)
Chunker-8             57.7ms ± 0%   57.6ms ± 0%  -0.16%  (p=0.035 n=9+10)
NewChunker-8          97.2µs ± 2%   93.0µs ± 1%  -4.28%  (p=0.000 n=9+10)

name                 old speed     new speed     delta
ChunkerWithSHA256-8  164MB/s ± 0%  164MB/s ± 0%  +0.20%  (p=0.001 n=10+10)
Chunker-8            582MB/s ± 0%  583MB/s ± 0%  +0.16%  (p=0.035 n=9+10)

Passing them by value causes 4kB to be copied on the stack.

name                 old time/op   new time/op   delta
ChunkerWithSHA256-8    205ms ± 0%    205ms ± 0%  -0.20%  (p=0.001 n=10+10)
Chunker-8             57.7ms ± 0%   57.6ms ± 0%  -0.16%  (p=0.035 n=9+10)
NewChunker-8          97.2µs ± 2%   93.0µs ± 1%  -4.28%  (p=0.000 n=9+10)

name                 old speed     new speed     delta
ChunkerWithSHA256-8  164MB/s ± 0%  164MB/s ± 0%  +0.20%  (p=0.001 n=10+10)
Chunker-8            582MB/s ± 0%  583MB/s ± 0%  +0.16%  (p=0.035 n=9+10)
@fd0
Copy link
Member

fd0 commented Jun 14, 2020

LGTM, thanks!

@fd0 fd0 merged commit 608952c into restic:master Jun 14, 2020
@greatroar greatroar deleted the pass-tables-by-pointer branch June 17, 2020 12:16
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.

None yet

2 participants