Skip to content

device: optimize Peer.String even more so #60

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AlexanderYastrebov
Copy link
Contributor

name          old time/op    new time/op    delta
PeerString-8    49.5ns ±17%    32.6ns ±17%  -34.09%  (p=0.000 n=10+10)

name          old alloc/op   new alloc/op   delta
PeerString-8     24.0B ± 0%     24.0B ± 0%     ~     (all equal)

name          old allocs/op  new allocs/op  delta
PeerString-8      1.00 ± 0%      1.00 ± 0%     ~     (all equal)

Signed-off-by: Alexander Yastrebov [email protected]

name          old time/op    new time/op    delta
PeerString-8    49.5ns ±17%    32.6ns ±17%  -34.09%  (p=0.000 n=10+10)

name          old alloc/op   new alloc/op   delta
PeerString-8     24.0B ± 0%     24.0B ± 0%     ~     (all equal)

name          old allocs/op  new allocs/op  delta
PeerString-8      1.00 ± 0%      1.00 ± 0%     ~     (all equal)

Signed-off-by: Alexander Yastrebov <[email protected]>
@zx2c4-bot zx2c4-bot force-pushed the master branch 7 times, most recently from 5ba9663 to c92064f Compare May 21, 2025 23:44
AlexanderYastrebov added a commit to AlexanderYastrebov/wireguard-go that referenced this pull request May 31, 2025
I am not sure why it must be fast but there were previous efforts
25ad08a and 9087e44
to speed it up; and I even did my own WireGuard#60.

If that is so important lets cache peer string to make it fast and readable again.

Signed-off-by: Alexander Yastrebov <[email protected]>
AlexanderYastrebov added a commit to AlexanderYastrebov/wireguard-go that referenced this pull request May 31, 2025
I am not sure why it must be fast but there were previous efforts
25ad08a and 9087e44
to speed it up; and I even did my own WireGuard#60.

If that is so important lets cache peer string to make it fast and readable again.

Signed-off-by: Alexander Yastrebov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant