tag:blogger.com,1999:blog-6263540079127134858.post3464409459528016138..comments2023-09-05T14:43:47.361+01:00Comments on Simonsite Blog: Roll Log4J log files on application startupSimonhttp://www.blogger.com/profile/09332244907672907509noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-6263540079127134858.post-19761116349353026712010-10-24T11:59:39.852+01:002010-10-24T11:59:39.852+01:00ZIP and GZ compression show dramatic performance i...ZIP and GZ compression show dramatic performance improvements in the new implementation available on <a href="http://www.simonsite.org.uk" rel="nofollow">my homepage</a>.Simonhttps://www.blogger.com/profile/09332244907672907509noreply@blogger.comtag:blogger.com,1999:blog-6263540079127134858.post-56413250604035673302010-10-11T21:32:39.459+01:002010-10-11T21:32:39.459+01:00Adrian, thanks for pointing that out. By coincide...Adrian, thanks for pointing that out. By coincidence another user, Oleksiy, has pointed out some performance issues with the GZ compression also. He's contributed some code to fix that and I'm working on testing at the moment. Whilst I'm doing this work I'll be sure to fix up the ZIP compression also. I hope to get a new release out pretty soon, within the next couple of weeks.Simonhttps://www.blogger.com/profile/09332244907672907509noreply@blogger.comtag:blogger.com,1999:blog-6263540079127134858.post-66770280663416870892010-10-11T19:15:28.408+01:002010-10-11T19:15:28.408+01:00The compression is extremely slow because you'...The compression is extremely slow because you're not using buffering in the addEntry method. Try something like this:<br /><br />byte buf[] = new byte[65536];<br />for (int len; (len = InputStream.read(buf)) > 0;) {<br />outputStream.write(buf, 0, len);<br />}<br /><br />I've added some timing for this specific section of code and it runs in 200ms vs 34s for 5MB of dummy logging (maybe in real-life conditions the improvement ratio will be slightly less).Adrian Carcunoreply@blogger.com