Re: RFR: JDK-8074579 Use more efficient and readable way of checking PKZIP signatures

2015-03-09 Thread Martin Buchholz
On Mon, Mar 9, 2015 at 3:22 PM, Xueming Shen wrote: > 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. > You're right - it will make a 20% improvement in something that is only a small par

Re: RFR: JDK-8074579 Use more efficient and readable way of checking PKZIP signatures

2015-03-09 Thread Xueming Shen
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:

Re: RFR: JDK-8074579 Use more efficient and readable way of checking PKZIP signatures

2015-03-09 Thread Martin Buchholz
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, especial

Re: RFR: JDK-8074579 Use more efficient and readable way of checking PKZIP signatures

2015-03-06 Thread Martin Buchholz
Err... #define PKZIP_SIGNATURE_AT(p, b2, b3) \ (((p)[0] == 'P') & ((p)[1] == 'K') & ((p)[2] == b2) & ((p)[3] == b3))

Re: RFR: JDK-8074579 Use more efficient and readable way of checking PKZIP signatures

2015-03-06 Thread Martin Buchholz
On Fri, Mar 6, 2015 at 1:37 PM, Xueming Shen wrote: > On 03/06/2015 12:46 PM, Martin Buchholz wrote: > >> Hi jar/zip maintainers, >> >> Here's an easy improvement. >> >> http://cr.openjdk.java.net/~martin/webrevs/openjdk9/PKsig/ < >> http://cr.openjdk.java.net/%7Emartin/webrevs/openjdk9/PKsig/> >

Re: RFR: JDK-8074579 Use more efficient and readable way of checking PKZIP signatures

2015-03-06 Thread Xueming Shen
On 03/06/2015 12:46 PM, Martin Buchholz wrote: Hi jar/zip maintainers, Here's an easy improvement. http://cr.openjdk.java.net/~martin/webrevs/openjdk9/PKsig/ https://bugs.openjdk.java.net/browse/JDK-8074579 Looks fine, assume the

RFR: JDK-8074579 Use more efficient and readable way of checking PKZIP signatures

2015-03-06 Thread Martin Buchholz
Hi jar/zip maintainers, Here's an easy improvement. http://cr.openjdk.java.net/~martin/webrevs/openjdk9/PKsig/ https://bugs.openjdk.java.net/browse/JDK-8074579