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

Use Ryu for Float/Double to String conversions #514

Closed
re-thc opened this issue Jan 26, 2019 · 9 comments
Closed

Use Ryu for Float/Double to String conversions #514

re-thc opened this issue Jan 26, 2019 · 9 comments
Labels
performance Issue related to performance problems or enhancements

Comments

@re-thc
Copy link

re-thc commented Jan 26, 2019

Hi, see https://github.com/ulfjack/ryu and the paper / benchmarks / information. Might help a lot in JSON output from Float / Double.

Cheers!

@cowtowncoder
Copy link
Member

@hc-codersatlas Thank you for the link! Looks potentially interesting. I don't have much time to look into this right now, but maybe someone else has, so it's good to have an issue filed.

@cowtowncoder cowtowncoder added the performance Issue related to performance problems or enhancements label Jan 27, 2019
@re-thc
Copy link
Author

re-thc commented Jan 27, 2019

Sounds good. Hopefully it gets picked up. Jsoniter adopted this and is 1 of the reasons it's faster.

@cowtowncoder
Copy link
Member

Qq: since #517 is related, wonder if these should be combined?

But as to @vy's question: I think that splitting definitely makes sense, but might make most sense to do "on-deman", when someone is considering working on specific aspect -- need not be a firm commitment, but just evaluation, so collaboration is easier wrt specific type or types.

@plokhotnyuk
Copy link

plokhotnyuk commented Mar 11, 2021

I switched jsoniter-scala from Ryu to Schubfach algorithm ~1 year ago. It brought guarantied shortest output with proper rounding. Also it gave a better throughput and minimized the tail latency.

Here is an original repo of the algorithm author that compiles only for Java 9+.

Here is its adoption in jsoniter-scala that works efficiently with Java 8 too.

@pjfanning
Copy link
Member

pjfanning commented Apr 12, 2022

I have https://github.com/pjfanning/double-reader-writer and #749 -- there is an open discussion on #746 about upgrading to Java 8 as a base in jackson 2.14

This issue seems closely related to #577

@cowtowncoder
Copy link
Member

cowtowncoder commented Jun 22, 2022

Will close, replaced by above-mentioned PRs for fast floating-point reads and writes, nominally #577 for reads and #749 for writes.

@pjfanning
Copy link
Member

We support Schubfach - which is also going to appear in new JDKs in future (#577 (comment))

@cowtowncoder
Copy link
Member

@pjfanning Feel free to improve titles and descriptions of relevant issues/PRs with references to algorithm(s) used. I am trying to figure out best ways to quickly indicate how improvements are achieved. I changed #577 title a bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Issue related to performance problems or enhancements
Projects
None yet
Development

No branches or pull requests

5 participants