(I have used Wanderlust on emacs for about 15 years now.)
I think using maildir directly may be hard to squeeze good performance out of with emacs. I'd suggest trying the alternatives: for eample, IMAP with ~30k messages should work decently in Wanderlust (and I would assume gnus), though initial load is slow (way less than hours, though). Using mu (maildir utils) via search in wanderlust to load 30k messages take about 1 minute, but if you are using mu you should be searching, not loading an entire mailbox. So there are probably some options out there, but I'd avoid loading 40k messages from a maildir directly.