The machine now runs fast, but when I use it without a power adapter, it regularly crashes, and often takes several tries to reboot. When it crashes, I get a beachball and am immediately unable to move to another program or force quit. The crashes are completely unrelated to the load on the system.
I've already taken the following steps to fix the problem:
1. I turned off the "put hard drive to sleep when not in use" option.
2. I turned off the hibernate setting in Terminal and erased the hibernate backup.
3. I downloaded Trim Enabler and enabled trim.
4. I disabled Time Machine local snapshots.
The issue existed before these changes, though, so they cannot be causing it. And the machine works perfectly as long as I don't unplug it.
Thanks so much for your help!
MacBook (13-inch Late 2009), OS X Mountain Lion (10.8.5)