We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
While testing the new init cost debugging output in go 1.16, I found that emoji has one of the higher memory init costs in Hugo's dependencies.
An an example, these are the init costs while running hugo version (which doesn't call into emoji):
hugo version
$ GODEBUG=inittrace=1 go run . version 2>&1 | rg emoji init github.com/kyokomi/emoji @15 ms, 3.9 ms clock, 783480 bytes, 3093 allocs
By deferring the emojiMap population until needed, emoji's init costs can be greatly reduced:
$ GODEBUG=inittrace=1 go run . version 2>&1 | rg emoji init github.com/kyokomi/emoji @21 ms, 0.009 ms clock, 2824 bytes, 30 allocs
I have a branch with these changes. I can submit a PR if you're interested.
The text was updated successfully, but these errors were encountered:
Thanks for the issue, @moorereason. #49 I used sync.Once to initialize the codeMap on the first use.
Sorry, something went wrong.
No branches or pull requests
While testing the new init cost debugging output in go 1.16, I found that emoji has one of the higher memory init costs in Hugo's dependencies.
An an example, these are the init costs while running
hugo version
(which doesn't call into emoji):By deferring the emojiMap population until needed, emoji's init costs can be greatly reduced:
I have a branch with these changes. I can submit a PR if you're interested.
The text was updated successfully, but these errors were encountered: