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

Setting StreamReadFeature.USE_FAST_DOUBLE_PARSER doesn't increase parsing throughput #117

Open
plokhotnyuk opened this issue Sep 26, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@plokhotnyuk
Copy link
Contributor

The feature for faster serialization of doubles that was introduced in 2.14.0-rc1 works fine when used in a factory builder for JsonGeneratorOps:
image
While a similar one for faster parsing of doubles doesn't increase parsing throughput:
image

@htmldoug
Copy link
Contributor

htmldoug commented Sep 26, 2022

Thanks for the heads up.

WeePickle can't use jackson-core to parse JSON doubles because of FasterXML/jackson-core#730, so the benchmark hits string.toDouble here (as of #102). Once jackson-core 2.14 lands, we should be able to change that over to use FastFloatParser directly, assuming it's part of the public API.

@pjfanning
Copy link

pjfanning commented Dec 14, 2022

We are not treating FastFloatParser as part of public jackson-core API. It is a copy of a class from https://github.com/wrandelshofer/FastDoubleParser. That project is now publishing regular releases - you are better off using its classes directly. The classes have been renamed a little. Jackson v2.15 will use a shaded version of FastDoubleParser classes grabbed during the build.

You will probably want the JavaDoubleParser or the JsonDoubleParser classes.

Edit: jackson-core NumberInput util is part of public API. You can use its parseDouble(String, boolean) method. The boolean param controls whether Double.parseString (false) or the internal FastDoubleParser classes are used. This version of the method is new in jackson-core 2.14.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants