Hey Joel,
thanks, I'll commit it.
Simon
> Hi--
> I've made a small patch that provides a large speedup
> for deploying .WAR files. The current implementation
> allocates a new 1Meg byte array for *every* file it
> extracts from the .WAR archive during deployment. I
> just changed it to allocate a new buffer only once,
> then re-use that buffer. It has decreased the
> deployment of the .WAR archive I've been working on
> from over 17 seconds to about 1.5 seconds. I'm sorry
> I'm not posting this to jboss-dev, but I'm not a
> member of that list, and my mailbox can't handle the
> deluge of cvs announcements from that list :-)
>
> Here's the patch. Hopefully someone with cvs access
> can apply it to the file:
> org.jboss.deployment.Installer
>
> The Installer-orig.java file is from the head of
> the cvs tree...
>
> -------------------------------------------------
> $ diff -u Installer-orig.java Installer.java
> -------------------------------------------------
>
>
> --- Installer-orig.java Tue Jan 23 01:42:22 2001
> +++ Installer.java Tue Jan 23 01:50:35 2001
> @@ -86,6 +86,9 @@
> // flag to not run execute twice
> boolean done;
>
> + //copy buffer we'll re-use for copying from
> + //an InputStream source to an OutputStream
> dest
> + private byte[] copyBuffer;
>
> // Static
> --------------------------------------------------------
>
> @@ -526,6 +529,17 @@
> return "/" + s.replace ('.', '/');
> }
>
> +
> +
> + /*
> + * Get the copy buffer (create new if null)
> + */
> + private byte[] getCopyBuffer(){
> + if(null == copyBuffer){
> + copyBuffer = new
> byte[1024*1024];
> + }
> + return copyBuffer;
> + }
>
> /** Writes all from one stream into the other.
> * @param _in the source
> @@ -536,7 +550,7 @@
> */
> private void copy (InputStream _in,
> OutputStream _out, boolean _closeInput) throws
> IOException
> {
> - byte[] buffer = new byte[1024*1024];
> + byte[] buffer = getCopyBuffer();
> int read;
> while (true)
> {
>
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - Buy the things you want at great prices.
> http://auctions.yahoo.com/
>
>
> --
> --------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> List Help?: [EMAIL PROTECTED]
>
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
List Help?: [EMAIL PROTECTED]