UI Updating can be hazardous to your performance...

Dare writes about a perf and memory usage issue in RSS Bandit.

I've come across this at least 10 times in my career - developers tend to underestimate the amount of time it takes to update a UI. I've seen cases where 70% of the cpu time is going towards updating the UI.

There are two classical fixes for this:

  1. Updating every <n> items. This gives you 90% of the gain possible, and it very simple to implement.
  2. If the updates are chunky - ie sometimes you get 100 per second and sometimes you get 2 per second - a time-based approach works better. Don't make an update until at least a specific interval has passed since the last one. I generally use 250 milliseconds for the interval.