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

[rust] object pooling #11

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

[rust] object pooling #11

wants to merge 3 commits into from

Conversation

ahdinosaur
Copy link
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.

None yet

1 participant