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
Separate maximum lengths of integer types (BigInteger
) and floating-point (BigDecimal
) in `StreamReadConstraints
#924
Comments
/cc @pjfanning -- Just hoping to nail this one before we do our 2.15 release candidates, sometime in early March (I hope). |
I am not convinced. BigInteger parsing is just about as slow as BigDecimal parsing. |
Really? Is the parsing of |
BigInteger and BigDecimal are by the far the most dangerous regarding parse times. FasterXML/jackson-module-scala#609 was caused by BigInteger parsing. |
Ok. My understanding on floating-point parsing performance is incorrect then. I'll close this issue. |
Ok I decided to have a look and you are right in that performance difference b/w About the only interesting finding is that:
(but with 200 digits, numbers are same... odd) So your point stands: performance of plain decoding (never mind use) is very similar for these "big number" cases. |
I know we have gone back and forth with this question, but I think that it would make sense to allow specifying different maximum lengths for integer numbers and floating-point numbers. This is mostly because:
BigInteger
handling) ANDBigInteger
may need to exceed anything that makes sense forBigDecimal
-- f.ex for cryptographic cases.Put another way: someone might want to cap FPs to, say, 100 digits, but allow
BigInteger
s with, say, over 1000 digits.Now: I think that we might want to leave a convenience method that sets both limits --
Builder.maxNumberLength()
-- while introducing new ones. We already have separate validation methods, but would need to separate accessors.And finally, we could consider changing defaults to be different; although I think default of
1000
is not a bad choice.The text was updated successfully, but these errors were encountered: