RFR: 8301873: Avoid string decoding in ZipFile.Source.getEntryPos [v7]

Eirik Bjorsnos duke at openjdk.org
Thu Feb 9 11:49:44 UTC 2023


On Thu, 9 Feb 2023 11:39:18 GMT, Claes Redestad <redestad at openjdk.org> wrote:

> Yes, I'll file a PR to see if we can make `startsWith` a bit sharper

Thanks! I pushed the change to ZipCoder.compare.

> In addition to - or instead of - an `equals` shortcut then if coders are the same we could use `ArraysSupport.mismatch` which should get similar speed and help more generally.

..and if String had (an optimized) mismatch method, then I bet all or most of the comparison methods (equals, compareTo, endsWith, startsWith, regionMatches) could delegate to that  :-)

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

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



More information about the security-dev mailing list