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

⚡️zb: don't clone signature when creating body #1292

Merged
merged 2 commits into from
Mar 9, 2025

Conversation

TTWNO
Copy link
Contributor

@TTWNO TTWNO commented Mar 7, 2025

We saw performance uplifts in the range of 10-15% in parsing events just by not cloning, reparsing the signature every time a body was created.

Hopefully it's a small enough change that it's easy to review.

This directly reduces the cost of calling Body::new(...) by 90-95%.

@TTWNO
Copy link
Contributor Author

TTWNO commented Mar 7, 2025

We saw performance uplifts in the range of 10-15% in parsing events just by not cloning, reparsing the signature every time a body was created.

Hopefully it's a small enough change that it's easy to review.

This directly reduces the cost of calling Body::new(...) by 90-95%.

@zeenix
Copy link
Contributor

zeenix commented Mar 7, 2025

We saw performance uplifts in the range of 10-15% in parsing events just by not cloning, reparsing the signature every time a body was created.

Hopefully it's a small enough change that it's easy to review.

This directly reduces the cost of calling Body::new(...) by 90-95%.

Wow, cool. Could you please:

  1. put this in the description of the PR and commit?
  2. add a benchmark for this (unless it's covered by the existing ones?)?

@TTWNO TTWNO force-pushed the no-clone-sig-body branch from 751415a to c17c255 Compare March 7, 2025 20:50
@TTWNO
Copy link
Contributor Author

TTWNO commented Mar 7, 2025

Added benchmarks. It's measured in nanoseconds so don't worry too much if there is a bit of variation here and there. But if it jumps into the hundreds of ns... then there might be a problem.

@TTWNO TTWNO force-pushed the no-clone-sig-body branch from c17c255 to 4f15956 Compare March 7, 2025 21:03
@zeenix
Copy link
Contributor

zeenix commented Mar 9, 2025

Added benchmarks.

Awesome! I'll move the commit order so it's possible to see the change. :)

It's measured in nanoseconds so don't worry too much if there is a bit of variation here and there. But if it jumps into the hundreds of ns... then there might be a problem.

Right, we already have a few benches that are in ns so I'm familiar with the drill. :)

TTWNO added 2 commits March 9, 2025 15:34
This temporarily takes the benchmark go slower by 50%. This will be
fixed in the next commit.
@zeenix zeenix force-pushed the no-clone-sig-body branch from 4f15956 to 80ff227 Compare March 9, 2025 15:39
@zeenix
Copy link
Contributor

zeenix commented Mar 9, 2025

@TTWNO I took the liberty of merging the new benchmark into the existing msg-de one and editting the commit log accordingly. I hope you don't mind. :)

@TTWNO
Copy link
Contributor Author

TTWNO commented Mar 9, 2025

All good by me. Thanks!

@zeenix zeenix merged commit de84e0a into dbus2:main Mar 9, 2025
8 checks passed
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