rmehner/spotify-remote — pull request #3 by mrnugget (2013-02-05 14:21:35+00:00)
Title: Reduce getCurrentState interval frequency to fix performance issue

This reduces the interval frequence for `getCurrentState` in
SpotifyRemoteServer from every 250ms to every 500ms.

Using an AppleScript every 250ms seems eat up up a lot of CPU power. The
`coreservicesd` process on OS X was responsible for 13-15% of total CPU usage
(according to `Activity Monitor.app`).

With this fix in place (polling Spotify only every 500ms) the `coreservicesd`
CPU usage goes down to 7-10%.

In order to keep the snappiness of the client interface, the connected sockets
now manually trigger `getCurrentState` on `volumeUp` and `volumeDown` events,
and trigger `getCurrentState` and `getCurrentTrack` on `next`, `previous` and
`playPause` events.