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 negative numbers #2

Closed
wants to merge 1 commit into from
Closed

Conversation

arthurprs
Copy link

@arthurprs arthurprs commented Jul 1, 2016

Include the negative sign in the buffer and write everything at once.

This will probably make no difference in most Writers but I guess it's still valid.

Include the negative sign in the buffer and write everything at once.
@dtolnay
Copy link
Owner

dtolnay commented Jul 1, 2016

Thanks but I benchmarked this and it performs about 20% worse for signed integer types. The extra if statement is very expensive.

@dtolnay dtolnay closed this Jul 1, 2016
@arthurprs
Copy link
Author

arthurprs commented Jul 1, 2016

Oh, I missed that. I guess it's not worth optimizing for non-buffered/memory writers anyway.

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