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 integer-to-string conversion in GenericWriter #31

Closed
miloyip opened this issue Jun 29, 2014 · 3 comments · Fixed by #80
Closed

Optimize integer-to-string conversion in GenericWriter #31

miloyip opened this issue Jun 29, 2014 · 3 comments · Fixed by #80
Milestone

Comments

@miloyip
Copy link
Collaborator

miloyip commented Jun 29, 2014

Current implementation is a basic algorithm which costs one division per decimal digit.
Compare with other faster implementations and adopt suitable algorithm.

@pah
Copy link
Contributor

pah commented Jun 29, 2014

Instead of maintaining a custom algorithm, another option might be to rely on default conversions from the C/C++ runtime and optionally provide a customization for (embedded) platforms without suitable implementations.

@miloyip
Copy link
Collaborator Author

miloyip commented Jun 30, 2014

Yes. Can try using sprintf("%d") but probably it should be the worst case, like this.
I have seen some better double to string conversion routines around as well.

@miloyip miloyip added this to the v1.0 Beta milestone Jul 10, 2014
@miloyip
Copy link
Collaborator Author

miloyip commented Jul 23, 2014

Since doing performance testing in current unit test is quite difficult, I have spent a week to create a side project itoa-benchmark.

This results show that, branchlut should be a good candidate to replace the "naive" implementation in RapidJSON. sse2 implementation has only minor performance gain over branchlut.

I have spent quite some time with Google Charts but I will reuse the framework for creating the JSON benchmark in near future.

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.

2 participants