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

[Networking] Use string concatenation in tracers\ #5640

Closed
peterargue opened this issue Apr 8, 2024 · 0 comments · Fixed by #5641
Closed

[Networking] Use string concatenation in tracers\ #5640

peterargue opened this issue Apr 8, 2024 · 0 comments · Fixed by #5641
Assignees

Comments

@peterargue
Copy link
Contributor

Problem Definition

I was reviewing a profile from an Access node and noticed that 1% of CPU on the node was used by fmt.Sprintf generating the ID for RPC tracer cache entries.

image

While this isn't a huge problem, the fix is very simple so we may as well make it.

Proposed Solution

Update the following code:

return flow.MakeIDFromFingerPrint([]byte(fmt.Sprintf("%s%s", messageId, controlMsgType)))

to use

flow.MakeIDFromFingerPrint([]byte(messageId + string(controlMsgType))) 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant