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

Speed up string printing #89

Merged
merged 1 commit into from
Jun 28, 2016
Merged

Speed up string printing #89

merged 1 commit into from
Jun 28, 2016

Conversation

dtolnay
Copy link
Member

@dtolnay dtolnay commented Jun 28, 2016

I am working on porting this benchmark to Rust. This change makes about 20-30% difference in citm_catalog.json and twitter.json which are heavy on strings.

Side note: together with #87 and #88 this brings us within 10% of RapidJSON which is the fastest C/C++ implementation (as measured by that benchmark).

@oli-obk
Copy link
Member

oli-obk commented Jun 28, 2016

awesome!

Implementation lgtm. Have you played around with unchecked indexing and/or a u8 -> [u8; 2] mapping instead of mapping the nibbles? It's not great for the caches, but they should be big enough to hold a 512 byte array.

@homu r+

@homu homu merged commit fc436eb into serde-rs:master Jun 28, 2016
homu added a commit that referenced this pull request Jun 28, 2016
Speed up string printing

I am working on porting [this benchmark](https://github.com/miloyip/nativejson-benchmark#stringify-time) to Rust. This change makes about 20-30% difference in citm_catalog.json and twitter.json which are heavy on strings.

Side note: together with #87 and #88 this brings us within 10% of RapidJSON which is the fastest C/C++ implementation (as measured by that benchmark).
@dtolnay dtolnay deleted the str branch June 28, 2016 08:32
@dtolnay
Copy link
Member Author

dtolnay commented Jun 28, 2016

I have not, but at this point I would like to turn my attention to parsing. There is a lot more to improve there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants