-
Notifications
You must be signed in to change notification settings - Fork 104
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
[ipfs/go-bitswap] internal.StartSpan spends half its time calling fmt.Sprintf #67
Comments
Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
Finally, remember to use https://discuss.ipfs.io if you just need general support. |
Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
Finally, remember to use https://discuss.ipfs.io if you just need general support. |
…nlined and folded at compiletime Fixes #67
…nlined and folded at compiletime Fixes ipfs#67
In the attached 30 second cpu profile, ipfs spends 16.11s calling
internal.StartSpan
. Almost half of that time (7.97s) is spent callingfmt.Sprintf
, which is used to prepend "Bitswap." to the operation name. However,StartSpan
is always called with a constant string, so if the callers were modified to add "Bitswap." to the operation name instead it would speed up the ipfs daemon by 26% in this case. Additionally, sinceStartSpan
would no longer create a new string that needs to be garbage-collected every time it is called, the CPU usage of the garbage collector would decrease as well.The text was updated successfully, but these errors were encountered: