Apple's Mail application will slow down over time. You'll know it is slower
when you try to swich from one folder to another in the app... it will take a
long time to display the list of messages.
Create a script like the one below and, after quitting Mail, run the script to restore Mail's performance.
After creating a file called 'fastmail' with the above content, make it executable like this:
chmod +x fastmail
You can only run fastmail when Mail is not running. You must Quit mail. After you quit mail, don't click anywhere... wait until Mail is no longer the foreground Application (e.g. until you no longer see Mail next to the apple icon in the upper left corner of your screen.) It can take a while for Mail to quit after you select Quit or press Apple-Q to quit, even though the Mail window has disappeared