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

perf: Avoid allocating some redundant Vec's during encoding #140

Merged
merged 5 commits into from
Jan 22, 2018

Conversation

Marwes
Copy link
Collaborator

@Marwes Marwes commented Jan 22, 2018

A couple of small and simple performance improvements I could do easily while looking through the code. There is definitely more that could be done here towards avoiding allocations but I didn't want to get sidetracked any further and that will be easier to build on top of the &mut Vec style as well.

 name                                        before ns/iter  after ns/iter  diff ns/iter   diff %  speedup
 bench_encode_pipeline                       498,750         515,194              16,444    3.30%   x 0.97
 bench_encode_pipeline_nested                329,036         225,092            -103,944  -31.59%   x 1.46
 bench_long_pipeline                         1,819,621       1,697,848          -121,773   -6.69%   x 1.07
 bench_simple_getsetdel                      89,985          90,718                  733    0.81%   x 0.99
 bench_simple_getsetdel_pipeline             35,303          35,811                  508    1.44%   x 0.99
 bench_simple_getsetdel_pipeline_precreated  34,209          33,526                 -683   -2.00%   x 1.02

@mitsuhiko mitsuhiko merged commit bb97bfe into redis-rs:master Jan 22, 2018
@mitsuhiko
Copy link
Contributor

lgtm!

@Marwes Marwes deleted the perf_encoding branch January 22, 2018 19:41
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