I'm running OS X Yosemite 10.10.1 on a mid 2012 13" MacBook Pro with the 2.5 GHz Intel Core i5 processor and 4GB of RAM. The hard drive (the 500 GB, regular HDD) was replaced about a year ago (close to 10 months after purchase) following a failure.
One morning, after waking up and waking the computer from sleep mode I encountered a strange amount of lag. It was bizarre because I was using the machine the night before without any problems, and now it was constantly stuttering while trying to play a movie on Netflix. Sound would play while the video froze every few seconds.
I restarted the computer, and the problem persisted. Moreover, it lags no matter what I do. iTunes can't make it through a song without freezing up 6-7 times, VLC constantly stutters too. The rainbow wheel pops up and spins any time I load a new page in Safari or Chrome, search with Spotlight, change pages in SimpleComic, change tabs in Finder, try and drag a file from one folder to another, etc.
It's constantly stuttering, freezing, and hanging any time I try and do just about anything. It usually only lasts 10-20 seconds, but it happens repeatedly. I've tried every remedy I know: restarting, repairing disk/permissions, turning off transparency, reinstalling OS X, restoring a Time Machine backup from before the problem, even clean reinstalling OS X. Nothing seems to work, there are no error messages, and I'm really annoyed.
I'd think it's a hardware problem, since a clean reinstall didn't work, but I ran the Apple Diagnostic Test and it found no problem. Moreover, everything works, just with crazy lag system-wide.
I'm wondering if anyone else has this problem, knows what it is, or if there's anything I can try that I haven't.
After a few tests, I've ruled out the logic board and HDD. I tried running the hard drive through an older Macbook, and it seemed to work alright (a little slower than normal, but it's a 2008 machine that hasn't been turned on in about a year so that's to be expected). I also started running OS X off an external hard drive, and it runs perfectly (which is why I think the logic board is fine).
Right now I think the issue stems from the SATA cable, which may be failing. I've ordered a replacement and I'll update this again once I've installed it.
Thanks for all the help so far!