RFR: 8339196: Optimize BufWriterImpl#writeU1/U2/Int/Long

Chen Liang liach at openjdk.org
Thu Aug 29 12:23:23 UTC 2024


On Wed, 28 Aug 2024 18:38:40 GMT, Claes Redestad <redestad at openjdk.org> wrote:

>> A small optimization makes BufWriterImpl's writeU1/U2/Int/Long methods more C2-friendly and improves performance.
>
> I made an off-list suggestion along this line some time before integration. IIRC it was a decent win back then, and with the merge store optimizations in place it might be even more impactful now.

@cl4es this is already downcasted to a byte, which is done via truncation like `& 0xFF` so I think the original `& 0xFF` is redundant.

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

PR Comment: https://git.openjdk.org/jdk/pull/20748#issuecomment-2317496731


More information about the core-libs-dev mailing list