Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

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

closed-fixed
nobody
None
5
2008-02-28
2008-02-27
No

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.

Discussion

  •  
    Attachments
  • Rick Knowles
    Rick Knowles
    2008-02-28

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

    Logged In: YES
    user_id=716353
    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.