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

Bench: optimise binary data generation #464

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

alexheretic
Copy link
Contributor

@alexheretic alexheretic commented Dec 13, 2024

I noticed slice::to_vec seems to be faster than .into() 🤷. This code is also more compatible with the proposed approach in #462

As this generates vec data faster it makes the bench faster (but just the bench) .

write 100k small messages then flush (server)
                        time:   [4.0320 ms 4.0390 ms 4.0672 ms]
                        change: [-8.8302% -8.3994% -7.9684%] (p = 0.05 > 0.05)

write+mask 100k small messages then flush (client)
                        time:   [5.3872 ms 5.3921 ms 5.4115 ms]
                        change: [-8.0997% -7.6006% -7.0983%] (p = 0.07 > 0.05)

Copy link
Member

@daniel-abramov daniel-abramov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed slice::to_vec seems to be faster than .into() 🤷

Huh! That's very interesting. Would not expect that either!

@daniel-abramov daniel-abramov merged commit f86036c into snapview:master Dec 13, 2024
7 checks passed
@alexheretic alexheretic deleted the optimise-bin-bench branch December 14, 2024 00:02
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