Wednesday, April 15, 2009

Putting Banshee to Work

Recently I have spent some time creating a smart job scheduler for Banshee. Some jobs we have include
  • Importing
  • Saving metadata to file
  • BPM analysis
BPM analysis and saving metadata to file jobs should be paused while doing speed sensitive jobs like importing. To achieve this, each job has priority hints and a list of resources it heavily uses. The priority hints are
  • SpeedSensitive, for jobs the user is actively waiting on, such as importing
  • LongRunning, for things like BPM or Mirage analysis of the entire library
And the resources are customizable, but currently I'm using
  • CPU
  • Disk
  • Database
If two jobs use the same resource
  • SpeedSensitive jobs run immediately (more than one ok)
  • Normal jobs (not SpeedSensitive or LongRunning) then follow, one at a time
  • LongRunning jobs then follow, one at a time
It is a bit of pretty low-level polish and a pretty simple idea, but it will give better performance and a better experience. The code is in a git branch for the moment, hopefully to be merged into trunk before 1.6.

3 comments:

  1. That looks really cool, we definitely need this to make things like mirage considerably less painful for the initial import. It is much the same issue we have with indexers such as Beagle really, unless there is good scheduling the initial import is going to be very annoying.

    On a sidenote, given that you have started pushing changes to a somewhat private git branch, does this mean banshee development has moved away from svn and if so where would an enterprising young'ish guy like myself go to trawl through changelogs to see what is being worked on for the purposes of writing long winded blog posts about upcoming coolness?

    ReplyDelete
  2. Quodlibet is doing something similar.. and it's working pretty well.. (using gobject, idle_add and iterators)

    https://svn.sacredchao.net/svn/quodlibet/trunk/quodlibet/quodlibet/util/copool.py

    ReplyDelete
  3. @david No, svn trunk (soon to be GNOME git) is the main place of development - you'll see from its ChangeLog that it's quite active. I'm just using git branches to work on fairly disruptive side ideas. Hopefully we'll have a more centralized way to do that soon (eg a GNOME-hosted gitorious instance).

    ReplyDelete