RFR: 8347009: Speed ​​up parseInt and parseLong [v6]

Shaojin Wen swen at openjdk.org
Mon Jan 27 18:16:49 UTC 2025


On Fri, 24 Jan 2025 19:39:00 GMT, Raffaello Giulietti <rgiulietti at openjdk.org> wrote:

>> Shaojin Wen has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - remove unused
>>  - Update src/java.base/share/classes/jdk/internal/util/DecimalDigits.java
>>    
>>    Co-authored-by: Chen Liang <liach at openjdk.org>
>
> I might be wrong, but I think that `&&` are compiled down to conditionals?
> The code optimistically assumes that the string is parsable as an `int|long`, so `&` might lead to simpler machine code.
> 
> Of course, if the benchmarks are good with `&&`, then please feel free to replace.

@rgiulietti 
I've made improvements based on your suggestions. Could you please review this PR again?

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

PR Comment: https://git.openjdk.org/jdk/pull/22919#issuecomment-2616554692


More information about the core-libs-dev mailing list