Re: Miscellaneous improvements to "jar".

2009-07-09 Thread Joseph D. Darcy
:58, Martin Buchholz <mailto:[email protected]>> wrote: I will atone for my use of nio2 by providing the backport to openjdk6. 6854795: Miscellaneous improvements to "jar" 6834805: Improve jar -C performance 6332094: "jar t" and "jar x" should us

Re: Miscellaneous improvements to "jar".

2009-07-09 Thread Martin Buchholz
of nio2 > by providing the backport to openjdk6. > > 6854795: Miscellaneous improvements to "jar" > 6834805: Improve jar -C performance > 6332094: "jar t" and "jar x" should use ZipFile, not ZipInputStream > 6496274: jar seems to use more CPU

Re: Miscellaneous improvements to "jar".

2009-07-06 Thread Xueming Shen
looks good. Joe Darcy wrote: On 07/06/09 01:58 PM, Martin Buchholz wrote: I will atone for my use of nio2 by providing the backport to openjdk6. 6854795: Miscellaneous improvements to "jar" 6834805: Improve jar -C performance 6332094: "jar t" and "jar x

Re: Miscellaneous improvements to "jar".

2009-07-06 Thread Joe Darcy
On 07/06/09 01:58 PM, Martin Buchholz wrote: I will atone for my use of nio2 by providing the backport to openjdk6. 6854795: Miscellaneous improvements to "jar" 6834805: Improve jar -C performance 6332094: "jar t" and "jar x" should use ZipFile, not ZipInputStream

Re: Miscellaneous improvements to "jar".

2009-07-06 Thread Martin Buchholz
I will atone for my use of nio2 by providing the backport to openjdk6. 6854795: Miscellaneous improvements to "jar" 6834805: Improve jar -C performance 6332094: "jar t" and "jar x" should use ZipFile, not ZipInputStream 6496274: jar seems to use more CPU than it sho

hg: jdk7/tl/jdk: 6854795: Miscellaneous improvements to "jar"

2009-07-06 Thread martinrb
Changeset: 0cabe1192c8b Author:martin Date: 2009-07-06 11:30 -0700 URL: http://hg.openjdk.java.net/jdk7/tl/jdk/rev/0cabe1192c8b 6854795: Miscellaneous improvements to "jar" Summary: cleanup of jar/Main.java (Initial patch by [email protected], additional review by

Re: Miscellaneous improvements to "jar".

2009-06-29 Thread Martin Buchholz
On Mon, Jun 29, 2009 at 16:58, Xueming Shen wrote: > Martin Buchholz wrote: > >> >> >> On Sun, Jun 28, 2009 at 22:47, Xueming Shen > [email protected]>> wrote: >> >> >>Looks fine. >> >>(1) "import java.nio.file.Paths" is not used by anyone. >> >> >> Let's make sure to start using nio2

Re: Miscellaneous improvements to "jar".

2009-06-29 Thread Xueming Shen
Martin Buchholz wrote: On Sun, Jun 28, 2009 at 22:47, Xueming Shen > wrote: Looks fine. (1) "import java.nio.file.Paths" is not used by anyone. Let's make sure to start using nio2 then... I meant this "import" might not be necessary? (2)nio2

Re: Miscellaneous improvements to "jar".

2009-06-29 Thread Martin Buchholz
ublic void updateEntry(ZipEntry e) { >> e.setMethod(ZipEntry.STORED); >> e.setSize(n); >> e.setCrc(crc.getValue()); >> } >> >> - addIndex was never updating the size

Re: Miscellaneous improvements to "jar".

2009-06-28 Thread Xueming Shen
holz mailto:[email protected]> <mailto:[email protected] <mailto:[email protected]>>> wrote: Hi jar team, I have a bunch of minor improvements to src/share/classes/sun/tools/jar/Main.java Tob

Re: Miscellaneous improvements to "jar".

2009-06-28 Thread Alan Bateman
Martin Buchholz wrote: : - using Path.moveTo is more likely to be atomic, so that a concurrent process is less likely to find the jar being updated missing. (Alan: is there a better way to do the common task of replacing a file with its transformed output?) The moveTo method does have the AT

Re: Miscellaneous improvements to "jar".

2009-06-28 Thread Ulf Zibis
Yes, thanks for the copious discussion. -Ulf Am 27.06.2009 23:27, Martin Buchholz schrieb: Let's take the latest code style as a compromise we can all live with. Martin On Sat, Jun 27, 2009 at 10:20, Ulf Zibis > wrote: Additional 2 cents, I more would like:

Re: Miscellaneous improvements to "jar".

2009-06-27 Thread Martin Buchholz
Let's take the latest code style as a compromise we can all live with. Martin On Sat, Jun 27, 2009 at 10:20, Ulf Zibis wrote: > Additional 2 cents, I more would like: > >> >> +return File.createTempFile("jartmp", null, (dir != null ? dir : >> new File("."))); >> > > or: > > +ret

Re: Miscellaneous improvements to "jar".

2009-06-27 Thread Ulf Zibis
Additional 2 cents, I more would like: +return File.createTempFile("jartmp", null, (dir != null ? dir : new File("."))); or: +return File.createTempFile("jartmp", null, + dir != null ? dir : new File(".")); -Ulf

Re: Miscellaneous improvements to "jar".

2009-06-27 Thread Ulf Zibis
Am 27.06.2009 18:56, Martin Buchholz schrieb: On Fri, Jun 26, 2009 at 10:33, Xueming Shen > wrote: The latest version looks good. 2 nit comments (1) it's reasonable to have createTempFileInSamDirectoryAs separate out, but I would keep the director

Re: Miscellaneous improvements to "jar".

2009-06-27 Thread Martin Buchholz
ticed because closeEntry was never >> called. >> >>private void addIndex(JarIndex index, ZipOutputStream zos) >>throws IOException >>{ >>ZipEntry e = new ZipEntry(INDEX_NAME); >>e.setTime(Syste

Re: Miscellaneous improvements to "jar".

2009-06-26 Thread Xueming Shen
Ulf Zibis wrote: Am 26.06.2009 17:47, Xueming Shen schrieb: Ulf, I do have a "prototype implementation" that uses buffer based read/write on Jar/ZipFile, it is not that "much" faster as you would have expected (basically the gain of using direct buffer comes from saving one or two memory copy

Re: Miscellaneous improvements to "jar".

2009-06-26 Thread Ulf Zibis
Find suitable abstractions and refactor them into a separate piece of code. The win is a lot bigger if you make the new abstractions public supported parts of the API, but that is harder with the JDK. Yep, I agree. Often that's my motivation to report RFE's e.g.: http://bugs.sun.com/bugdatab

Re: Miscellaneous improvements to "jar".

2009-06-26 Thread Ulf Zibis
Am 26.06.2009 17:47, Xueming Shen schrieb: Ulf, I do have a "prototype implementation" that uses buffer based read/write on Jar/ZipFile, it is not that "much" faster as you would have expected (basically the gain of using direct buffer comes from saving one or two memory copy of the content,

Re: Miscellaneous improvements to "jar".

2009-06-26 Thread Ulf Zibis
Am 26.06.2009 18:45, Xueming Shen schrieb: Ulf Zibis wrote: Motivation: Xueming states: *"dat" based uses less disk space, but it has larger startup time, reading an additional "big" dat file during class loading/initializing actually takes much longer time than I expected (I hit the extreme

Re: Miscellaneous improvements to "jar".

2009-06-26 Thread Xueming Shen
/%7Emartin/jar-misc.0/> Martin On Wed, Jun 24, 2009 at 19:34, Martin Buchholz mailto:[email protected]>> wrote: Hi jar team, I have a bunch of minor improvements to src/share/classes/sun/tools/jar/Main.java Toby and Xueming,

Re: Miscellaneous improvements to "jar".

2009-06-26 Thread Martin Buchholz
On Fri, Jun 26, 2009 at 09:31, Ulf Zibis wrote: > Martin, thanks for taking the time. > > Am 26.06.2009 15:53, Martin Buchholz schrieb: > > > > On Fri, Jun 26, 2009 at 01:37, Ulf Zibis wrote: > >> 1. Hopefully some volunteer would be found to fix >> http://bugs.sun.com/bugdatabase/view_bug.do?b

Re: Miscellaneous improvements to "jar".

2009-06-26 Thread Xueming Shen
Ulf Zibis wrote: Motivation: Xueming states: *"dat" based uses less disk space, but it has larger startup time, reading an additional "big" dat file during class loading/initializing actually takes much longer time than I expected (I hit the extreme when I worked on the EUC_TW, which I make t

Re: Miscellaneous improvements to "jar".

2009-06-26 Thread Ulf Zibis
Oops, I'm not as fast as you two, writing in english. :-( -Ulf Am 26.06.2009 18:04, Martin Buchholz schrieb: Removing one layer of BufferedInputStream in my change saves one bulk copy per file. And reusing the same buffer saves on cache misses and GC. But bulk copy is actually very fast, (esp

Re: Miscellaneous improvements to "jar".

2009-06-26 Thread Ulf Zibis
Martin, thanks for taking the time. Am 26.06.2009 15:53, Martin Buchholz schrieb: On Fri, Jun 26, 2009 at 01:37, Ulf Zibis > wrote: 1. Hopefully some volunteer would be found to fix http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6818737 before JDK7 AP

Re: Miscellaneous improvements to "jar".

2009-06-26 Thread Martin Buchholz
Removing one layer of BufferedInputStream in my change saves one bulk copy per file. And reusing the same buffer saves on cache misses and GC. But bulk copy is actually very fast, (especially as memory is becoming more like disk), so the win is relatively small. I would be surprised if you could

Re: Miscellaneous improvements to "jar".

2009-06-26 Thread Xueming Shen
Martin Buchholz wrote: On Fri, Jun 26, 2009 at 01:37, Ulf Zibis > wrote: Am 26.06.2009 02:57, Martin Buchholz schrieb: I did some benchmarking, and found that my changes "only" make jar 10-20% faster. Disappointing - we expect an order of

Re: Miscellaneous improvements to "jar".

2009-06-26 Thread Martin Buchholz
On Fri, Jun 26, 2009 at 01:37, Ulf Zibis wrote: > Am 26.06.2009 02:57, Martin Buchholz schrieb: > >> I did some benchmarking, >> and found that my changes "only" make jar 10-20% faster. >> Disappointing - we expect an order of magnitude for every commit! >> > > 1. Hopefully some volunteer would b

Re: Miscellaneous improvements to "jar".

2009-06-26 Thread Ulf Zibis
Am 26.06.2009 02:57, Martin Buchholz schrieb: I did some benchmarking, and found that my changes "only" make jar 10-20% faster. Disappointing - we expect an order of magnitude for every commit! 1. Hopefully some volunteer would be found to fix http://bugs.sun.com/bugdatabase/view_bug.do?bug_id

Re: Miscellaneous improvements to "jar".

2009-06-25 Thread Martin Buchholz
I forgot to mention that I upgraded the "n" field in CRC32OutputStream from int to long. That might be a bug fix for when the input file is longer than Integer.MAX_VALUE, which is possible even without ZIP64 support. -int n = 0; +long n = 0; Martin

Re: Miscellaneous improvements to "jar".

2009-06-25 Thread Martin Buchholz
rtin/jar-misc/> > Previous webrev: > http://cr.openjdk.java.net/~martin/jar-misc.0/<http://cr.openjdk.java.net/%7Emartin/jar-misc.0/> > > Martin > > > > On Wed, Jun 24, 2009 at 19:34, Martin Buchholz wrote: > >> Hi jar team, >> >> I have a b

Re: Miscellaneous improvements to "jar".

2009-06-25 Thread Martin Buchholz
On Thu, Jun 25, 2009 at 13:04, Xueming Shen wrote: > >> yes, it now solved the puzzle:-) > > (1)closeEntry() is not strictly necessary, either putNextEntry or close() > will close the previous entry > (2)you might want to go a little further to "encapsulate" the updateEntry > into crc32os, pass

Re: Miscellaneous improvements to "jar".

2009-06-25 Thread Xueming Shen
Martin Buchholz wrote: I have an updated version of this fix, with these changes: - Documented the turkish i problem /** * Compares two strings for equality, ignoring case. The second * argument must contain only upper-case ASCII characters. * We don't want case comparison t

Re: Miscellaneous improvements to "jar".

2009-06-25 Thread Martin Buchholz
> Xueming, please file a bug. > > Synopsis: Miscellaneous improvements to "jar". > Description: > - Use standard jdk coding style for javadoc > - Don't create a temp file for jar index in STORED mode. > - Don't use synchronized collections. > - Fix javac

Re: Miscellaneous improvements to "jar".

2009-06-25 Thread Xueming Shen
Martin Buchholz wrote: Xueming, Congratulations for finding the incompatible change! Yes, if you are running in a turkish locale (unlikely) and if your jar file has the index entry in lower case, (unlikely - hopefully INDEX.LIST files are all machine generated). then it will not be found in the

Re: Miscellaneous improvements to "jar".

2009-06-25 Thread Martin Buchholz
ng, please review. >> >> Warning: the index code has not been maintained for many years. >> >> Xueming, please file a bug. >> >> Synopsis: Miscellaneous improvements to "jar". >> Description: >> - Use standard jdk coding style for javadoc &g

Re: Miscellaneous improvements to "jar".

2009-06-25 Thread Xueming Shen
h of minor improvements to src/share/classes/sun/tools/jar/Main.java Toby and Xueming, please review. Warning: the index code has not been maintained for many years. Xueming, please file a bug. Synopsis: Miscellaneous improvements to "jar". Description: - Use standard jdk coding style

Re: Miscellaneous improvements to "jar".

2009-06-25 Thread Martin Buchholz
de has not been maintained for many years. >> >> Xueming, please file a bug. >> >> Synopsis: Miscellaneous improvements to "jar". >> Description: >> - Use standard jdk coding style for javadoc >> - Don't create a temp file for jar index in STORED mode.

Re: Miscellaneous improvements to "jar". /typo correction

2009-06-25 Thread Ulf Zibis
many years. Xueming, please file a bug. Synopsis: Miscellaneous improvements to "jar". Description: - Use standard jdk coding style for javadoc - Don't create a temp file for jar index in STORED mode. - Don't use synchronized collections. - Fix javac warnings. - Don't define

Re: Miscellaneous improvements to "jar".

2009-06-25 Thread Ulf Zibis
Buchholz schrieb: Hi jar team, I have a bunch of minor improvements to src/share/classes/sun/tools/jar/Main.java Toby and Xueming, please review. Warning: the index code has not been maintained for many years. Xueming, please file a bug. Synopsis: Miscellaneous improvements to "jar". D

Re: Miscellaneous improvements to "jar".

2009-06-24 Thread Xueming Shen
6854795 Martin Buchholz wrote: Hi jar team, I have a bunch of minor improvements to src/share/classes/sun/tools/jar/Main.java Toby and Xueming, please review. Warning: the index code has not been maintained for many years. Xueming, please file a bug. Synopsis: Miscellaneous improvements

Miscellaneous improvements to "jar".

2009-06-24 Thread Martin Buchholz
Hi jar team, I have a bunch of minor improvements to src/share/classes/sun/tools/jar/Main.java Toby and Xueming, please review. Warning: the index code has not been maintained for many years. Xueming, please file a bug. Synopsis: Miscellaneous improvements to "jar". Descript