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

[ipfs/go-bitswap] internal.StartSpan spends half its time calling fmt.Sprintf #67

Closed
m42a opened this issue Oct 23, 2022 · 2 comments
Closed
Labels
need/triage Needs initial labeling and prioritization

Comments

@m42a
Copy link

m42a commented Oct 23, 2022

In the attached 30 second cpu profile, ipfs spends 16.11s calling internal.StartSpan. Almost half of that time (7.97s) is spent calling fmt.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, since StartSpan 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.

@m42a m42a added the need/triage Needs initial labeling and prioritization label Oct 23, 2022
@welcome
Copy link

welcome bot commented Oct 23, 2022

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment.
Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

  • "Priority" labels will show how urgent this is for the team.
  • "Status" labels will show if this is ready to be worked on, blocked, or in progress.
  • "Need" labels will indicate if additional input or analysis is required.

Finally, remember to use https://discuss.ipfs.io if you just need general support.

@Jorropo Jorropo changed the title internal.StartSpan spends half its time calling fmt.Sprintf [ipfs/go-bitswap] internal.StartSpan spends half its time calling fmt.Sprintf Jan 27, 2023
@Jorropo Jorropo transferred this issue from ipfs/go-bitswap Jan 27, 2023
@welcome
Copy link

welcome bot commented Jan 27, 2023

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment.
Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

  • "Priority" labels will show how urgent this is for the team.
  • "Status" labels will show if this is ready to be worked on, blocked, or in progress.
  • "Need" labels will indicate if additional input or analysis is required.

Finally, remember to use https://discuss.ipfs.io if you just need general support.

Jorropo added a commit that referenced this issue Dec 8, 2023
@Jorropo Jorropo closed this as completed in 483bc39 Dec 8, 2023
wenyue pushed a commit to wenyue/boxo that referenced this issue Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need/triage Needs initial labeling and prioritization
Projects
None yet
Development

No branches or pull requests

1 participant