I'm really getting sick of Mail.app in OS X - its far too slow, and it doesn't fit in with the unix toolchain very well. To remedy my situation I sat down to write an mbox parser. The general algorithm I built first in Perl, to test its validity, and ran against several different mbox files I have, just to make sure it worked and was fast enough.
I then translated the algorithm into MailReader.m. It works fine for small mailfiles (I mean really small, like 4 messages). When I ran it on a small-medium sized mbox file (1280 messages) it blew up. Completely. The process grew to 1.8gigs before I gave up and pressed stop in the build-run cycle.
No wonder Mail.app doesn't use mbox, its impossible to parse using Cocoa without grinding the system to an absolute halt.