The DotTerminatedOutputStream has a small "typo" in it that causes an
interesting performance problem, however it still maintains correctness.
The write(byte[],int,int) method calls the super.write(byte[],int,int) method
instead of out.write(byte[],int,int) method. Calling super will cause the
OutputStream's default implementation to call write(int) for every byte in the
array. This causes a major slow down.
In my app I have fixed the typo. This is the result:
before: Message rate (message/s): 33.229
after: Message rate (message/s): 332.775
That is a 10x improvement.
The app is sending ~20KB email messages repeatedly.
Original issue reported on code.google.com by miah.n...@gmail.com on 1 Mar 2013 at 4:15
Original issue reported on code.google.com by
miah.n...@gmail.com
on 1 Mar 2013 at 4:15Attachments: