#28 WinstoneOutputStream.write(byte[],int,i) performance problem


WinstoneOutputStream doesn't implement the version of the write method that takes (byte[],int,int), so when data is written, the write(int) method is called repeatedly.

This is already inefficient to begin with, but it gets worse when the Content-Length header is set. One of the Hudson users reported this, and said that on his machine this means Winstone can serve only 200kb/sec with 100% CPU usage.

I'm attaching the patch for this problem.


  • Rick Knowles

    Rick Knowles - 2008-02-28
    • status: open --> closed-fixed
  • Rick Knowles

    Rick Knowles - 2008-02-28

    Logged In: YES
    Originator: NO

    Updated in cvs. Thanks for pointing it out - this is kind of an embarassing bug to have found by someone else after all this time.

    You're correct about the cpu usage implications, but luckily because of the internal buffering this wasn't additionally translating into byte-by-byte I/O wait as well. Hopefully the patch will address it.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks