james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Markus Wiederkehr" <markus.wiederk...@gmail.com>
Subject Re: [mime4j] Simple benchmark for testing performance of the MIME stream parser
Date Sat, 03 Jan 2009 20:15:10 GMT
On Wed, Dec 24, 2008 at 7:21 PM, Oleg Kalnichevski <olegk@apache.org> wrote:
> Folks
> I took liberty to commit an ultra-simple benchmark I use for testing
> performance of the MIME stream parser.
> http://svn.apache.org/viewvc?view=rev&revision=729347
> Feel free to improve / extend / remove if useless.

I have extended the class a bit. It is now possible to choose from
four different tests.

Test 0 is the one Oleg wrote. It reads from a MimeTokenStream until
its end is reached.
Test 1 uses a MimeStreamParser and reports to an empty AbstractContentHandler.
Test 2 uses a MimeStreamParser and reports to an empty SimpleContentHandler.
Test 3 creates Message objects in memory.

On my machine the results are:
Test 0: ~ 8 sec
Test 1: ~ 8 sec
Test 2: ~ 41 sec
Test 3: ~ 47 sec

So it looks like parsing the header fields consumes about 80 percent of test 2.

The difference between #2 and 3 is probably caused by copying the
message bodies into Storage objects.

Maybe the header fields should be parsed lazily? Does anybody have a
better idea?


PS: I have also written a test that creates a JavaMail MimeMessage.
That takes about 12 seconds on my machine.

To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org

View raw message