RFR: 8299982: (bf) Buffer.checkIndex(int, int) should use Objects.checkIndex(int, int)

Sergey Tsypanov stsypanov at openjdk.org
Wed Jan 25 08:59:04 UTC 2023


On Tue, 24 Jan 2023 22:07:51 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

> Replace explicit check of indexes in `Buffer::checkIndex(int,int)` with a call to `Objects::checkIndex(int,int)` in order to improve the throughput of other methods which invoke `Buffer::checkIndex(int,int)`.

> <html>
<body>


size | before | after
-- | -- | --
1 | 4.863 | 3.605


</body>
</html>

Why does it make such a significant difference? Intrinsic?

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

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


More information about the nio-dev mailing list