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

optimize anything using WriteString #85

Merged
merged 2 commits into from
Aug 18, 2023

Conversation

whyrusleeping
Copy link
Owner

The interface type assertion of io.WriteString was showing up pretty noticeably in some of my benchmarks, this makes that go away (almost) entirely. The benchmark in question went from around 3600ns/op to 3100ns/op.

Copy link
Collaborator

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... if you say so

@whyrusleeping
Copy link
Owner Author

yeah i kinda didnt expect interface assertions to be expensive, but for 'map' style cbor objects youre writing a string every other field, and apparently the calls add up?

@Stebalien
Copy link
Collaborator

Yeah, it's one of those "compile time" v. "run time" tradeoffs the go devs made.

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