Withdrawn: 8347009: Speed ​​up parseInt and parseLong

duke duke at openjdk.org
Wed Apr 23 07:25:50 UTC 2025


On Sat, 4 Jan 2025 10:24:15 GMT, Shaojin Wen <swen at openjdk.org> wrote:

> This is an optimization for decimal Integer.parseInt and Long.parseLong, which improves performance by about 10%. The optimization includes:
> 1. Improve performance by parsing 2 numbers at a time, which has performance improvements for numbers with length >= 3.
> 2. It uses charAt(0) for the first number. Assuming that the optimization can eliminate boundary checks, this will be more friendly to parsing numbers with length 1.
> 3. It removes the reliance on the Character.digit method and eliminates the reliance on the CharacterDataLatin1#DIGITS cache array, which avoids performance degradation caused by cache misses.

This pull request has been closed without being integrated.

-------------

PR: https://git.openjdk.org/jdk/pull/22919


More information about the core-libs-dev mailing list