RFR: JDK-8074579 Use more efficient and readable way of checking PKZIP signatures
Xueming Shen
xueming.shen at oracle.com
Mon Mar 9 22:22:54 UTC 2015
The result looks good, though I doubt it will bring in any real "meaningful" performance
improvement when reading a zip/jar file. But faster is faster. The same improvement might
not applied to the java version, given those range check?
-Sherman
On 03/09/2015 01:14 PM, Martin Buchholz wrote:
> I actually benchmarked my last suggestion to be 20% faster on an ad-hoc microbenchmark. We can go faster yet on x86 if we use unaligned 4-byte uint32 reads. Maybe in a future change.
>
> In general, hardware is moving in the direction of allowing unaligned reads without performance penalty, especially on x86, and it would be good to start taking advantage of that.
>
> On Fri, Mar 6, 2015 at 9:50 PM, Martin Buchholz <martinrb at google.com <mailto:martinrb at google.com>> wrote:
>
> Err...
>
> #define PKZIP_SIGNATURE_AT(p, b2, b3) \
> (((p)[0] == 'P') & ((p)[1] == 'K') & ((p)[2] == b2) & ((p)[3] == b3))
>
>
More information about the core-libs-dev
mailing list