What OS X are you running?
It would help us to help you if we could have some more technical info about your iMac.
If you so choose, please download, install and run Etrecheck.
Etrecheck was developed as a simple Mac diagnostic reporting tool by a regular Apple Support forum user and technical support contributor named Etresoft.
Etrecheck is a small, unobstrusive app that compiles a static snapshot of your entire Mac hardware system and installed software.
This is a free app that has been honestly created to provided help in diagnosing issues with Macs running the new OS X 10.9 Mavericks.
It is not malware and can be safely downloaded and installed onto your Mac.
http://www.etresoft.com/etrecheck
Copy/paste and post its report here in another reply thread so that we have a complete profile of your Mac's hardware and installed software so we can all help with your Mac performance issues.