Because it's an iMac, I'm assuming that you're using the bluetooth keyboard and possibly a trackpad or bluetooth mouse.
If this is the case and you're only having the problem when connected via Wi-Fi, you may be experiencing interference.
Bluetooth runs at 2.4ghz, Wi-Fi routers can run at either 2.4ghz or 5ghz.
When I installed Mavericks on my iMac, wireless speeds took a dive and it took me a lot of troubleshooting to figure out.
It was a strange problem because I hadn't changed my network at all and out of 3 devices connected to it, the iMac was the only one having speed issues on Wi-Fi; and only after installing Mavericks. It was working fine the day before under OS X Snow Leopard.
Give this a try:
- Option-click on Wi-Fi in the menu bar.
- Go to 'Open wireless diagnostics'. (You may have to enter your admin password)
- Ignore the introduction window that pops up and instead go to 'Window > Utilities' in the menu bar. (alternatively press ⌘-2).
- Click on 'Wi-Fi Scan'.
- Click 'Scan Now'.
This will show you all of the wireless networks in your area, what channel they're on, and the band (2.4ghz or 5ghz).
- If your wireless network is using the 2.4ghz band, change the broadcast channel in your router settings. (You'll have to refer to your router's manual if you don't already know how to do this).
- Choose a channel that is different than the channel you are currently using and also different to the other wireless networks in your area.
This may not be a fix for everyone, but it solved a wireless problem that had been plaguing me since installing Mavericks.