Skip to content

[rust] object pooling#11

Open
ahdinosaur wants to merge 3 commits into
mainfrom
perf/object-pooling
Open

[rust] object pooling#11
ahdinosaur wants to merge 3 commits into
mainfrom
perf/object-pooling

Conversation

@ahdinosaur
Copy link
Copy Markdown
Owner

@ahdinosaur ahdinosaur commented May 23, 2023

inspired by https://www.reddit.com/r/rust/comments/ozpspr/improved_my_base64_encoders_performance_3x_by/,

i tried to re-use the many ObjectEntry objects that get created (and their byte Vec<u8>'s) using a pool.

benchmarks look very promising!

                        time:   [13.003 µs 13.027 µs 13.061 µs]
                        thrpt:  [76.564 Kelem/s 76.761 Kelem/s 76.904 Kelem/s]
                 change:
                        time:   [-39.290% -39.190% -39.087%] (p = 0.00 < 0.05)
                        thrpt:  [+64.169% +64.447% +64.716%]

at the moment is broken, but bench is very promising:

```
                        time:   [14.653 µs 14.666 µs 14.678 µs]
                        thrpt:  [68.127 Kelem/s 68.187 Kelem/s 68.245 Kelem/s]
                 change:
                        time:   [-32.673% -32.541% -32.415%] (p = 0.00 < 0.05)
                        thrpt:  [+47.962% +48.238% +48.529%]
                        Performance has improved.
```
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.

1 participant