Decimal and and hexadecimal parsing of String inputs are based on quite different code shapes. However, the parsing proper is almost unaffected by the radix (10 and 16, resp.), and can be unified in a single parameterized algorithm.
Moreover, resource consumption (CPU and memory) during parsing can be considerably reduced when facing huge inputs (e.g., malicious inputs).
In fact, before the mathematical conversion itself, the proposed parsing does instantiate objects, meaning that errors can be detected without heap allocations.
Finally, conversion can be achieved with less CPU and memory consumption.
Moreover, resource consumption (CPU and memory) during parsing can be considerably reduced when facing huge inputs (e.g., malicious inputs).
In fact, before the mathematical conversion itself, the proposed parsing does instantiate objects, meaning that errors can be detected without heap allocations.
Finally, conversion can be achieved with less CPU and memory consumption.
- relates to
-
JDK-8345403 Add more randomized tests to better cover FloatingDecimal parsing
- New