Mail started choking when I had an IMAP folder with about 16000 messages in it; it'd hang for minutes at a time, it'd crash, etc., etc. and finally I couldn't take it anymore and picked up Thunderbird again, which handles the same setup with the same volume, but without the freezing or the crashing.