Yosemite on an Early 2008 iMac 20" with 4GB gives too many beachballs
There are a couple of Things you could try:


run "Disk Utilities.app" from /Applications/Utilities and start 'Check Volume' and 'Repair File Permission' there are probably some issues here
start the "Console.app", also found in /Applications/Utilities/ and check for errors while starting
Clear the Caches either by starting the Mac in single User Mode (press and hold the shift-key while starting up) and restart the Machine again. Best would be to run 'Onyx' and clear out the Boot Cache.


Don't forget that spotlight would be reindexing your machine after an upgrade, so that could be an explanation for the slow performance at first.