Skip to content

Instantly share code, notes, and snippets.

@jstedfast
Created April 24, 2014 17:49
Show Gist options
  • Save jstedfast/11263328 to your computer and use it in GitHub Desktop.
Save jstedfast/11263328 to your computer and use it in GitHub Desktop.
Email exchange with LimiLabs
On Thu, Apr 24, 2014 at 1:09 PM, Pawel Lesnikowski <lesnikowski@limilabs.com
> wrote:
> In many places you claim that Mail.dll does not include proper parsing,
>
Where do I make this claim? It says only that MimeKit is faster, which is
true.
> and suggest that it is regex based - this is not true.
>
Where have I said this?
> You also claim it is magnitude slower, without any tests.
>
The source code for the tests is on my blog post. I do not have source for
a benchmark for your library as it was not me who ran the benchmarking
tests on your library, it was one of your customers who made the switch to
MimeKit. I could ask him for the source (or, I'm sure, you could easily
write a test based on the source code of the tests I *did* publish on my
blog).
>
> I don't like you using my product as a way to promote your library.
>
I'm sorry you feel that way, but the exciting thing about MimeKit is that
it really is the fastest MIME parser I can find. Some developers out there
will care about that, others will not. If you don't have a fast parser, it
doesn't mean you can't market your product as a more comprehensive
solution. For example, perhaps your library has fancy features that my
MimeKit library does not have (even if and when it is combined with my
MailKit library which does SMTP, POP3, AND IMAP). Focus on Mail.dll's
advantages.
> If it works and is good (and it seems it is), it will defend itself.
> No need to bully others.
>
I do not feel that I have bullied you and your objections to the text on my
GitHub project page have so far not been accurate. I never claimed that
your library was Regex based (how could I know? I do not have the source
code for your library). Nor have I said that it did not include proper
parsing. I do not use your library so I have no comment on it other than
the performance tests which were run by a customer of yours.
Here is what your customer said to me:
> Thanks, I downloaded the file and created a small test program to try
both out. MimeKit was done after 13.4937347 seconds. Mail.dll is still
running :) For....something like 10 minutes now. Stopping...
> Let me see. Ok, 100 messages takes 4.6257416, so it should take about
925.14832 seconds, or 15.42 minutes. I'd say MimeKit won that one :)
Is my claim that MimeKit is faster than Mail.dll not accurate? Is it not
orders of magnitude faster as I stated?
If you find that your own customer was wrong and that your own tests show
that Mail.dll is not, in fact, orders of magnitude slower than MimeKit,
then I would be happy to remove the statements (as they would be incorrect).
Here is the source code for the benchmark test for MimeKit that these
results are based on so that you may reproduce the results:
using System;
using System.IO;
using System.Diagnostics;
using MimeKit;
namespace MimeKitParser {
class Program
{
public static void Main (string[] args)
{
var stream = File.OpenRead (args[0]);
var stopwatch = new Stopwatch ();
stopwatch.Start ();
for (int i = 0; i < 20000; i++) {
var parser = new MimeParser (stream, MimeFormat.Default);
var message = parser.ParseMessage ();
stream.Position = 0;
}
stopwatch.Stop ();
Console.WriteLine ("Parsed 20,000 messages in {0}",
stopwatch.Elapsed);
}
}
}
And here is the message that was used in the benchmarking test:
https://gist.github.com/jstedfast/8419032
You can improve MimeKit's performance even more by passing 'true' as an
optional third argument to MimeParser's .ctor. E.g.:
new MimeParser (stream, MimeFormat.Default, true);
I'm sure that you can write your own test for Mail.dll that would be
comparable to the benchmark program above to compare them.
Looking forward to hearing back from you.
Jeff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment