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

avoid fmt.Errorf calls for an error that is never read (reduce useless memory allocs) #2349

Closed
wants to merge 1 commit into from

Conversation

sduchesneau
Copy link

While chasing memory allocations (heavy usage of WASM modules, leading to thrashing golang garbage collector ...),
I found a lot of fmt.Errorf() called, without any error resurfacing.

The content of these errors are always ignored, so it makes more sense to reuse the same error object, saving a lot of object memory allocations.

@mathetake
Copy link
Member

mind sharing how this could be a memory pressure bottleneck in practice?

@mathetake mathetake closed this Dec 23, 2024
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