Removing one layer of BufferedInputStream<br>in my change saves one bulk copy per file.<br>And reusing the same buffer saves on cache misses<br>and GC. But bulk copy is actually very fast,<br>(especially as memory is becoming more like disk),<br>
so the win is relatively small.<br><br>I would be surprised if you could get more than<br>the 10-20% that I've gotten with this change,<br>by using direct buffers.<br><br>Martin<br><br><div class="gmail_quote">On Fri, Jun 26, 2009 at 08:47, Xueming Shen <span dir="ltr"><<a href="mailto:Xueming.Shen@sun.com">Xueming.Shen@sun.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
I do have a "prototype implementation" that uses buffer based read/write on Jar/ZipFile, it<br>
is not that "much" faster as you would have expected (basically the gain of using direct buffer<br>
comes from saving one or two memory copy of the content, which is very faster, compared to<br>
the "real hard" work of moving bits from harddisk to memory). While it's still something<br>
worth doing, but definitely not a high priority for now, yes, it's on the list.<br>
<br>
Sherman<br>
</blockquote></div><br>