voodoodyne / subethasmtp

SubEtha SMTP is a Java library for receiving SMTP mail
Other
343 stars 138 forks source link

performance problem with DotTerminatedOutputStream #58

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by hontvari@flyordie.com on 11 Mar 2013 at 9:41

kastoestoramadus commented 8 years ago

Hi, what is the state of applying this kindly advice? As I see it is not in latest release.