Menu

#1 Reading iTunes library blocks app for several seconds

open
nobody
5
2004-05-31
2004-05-31
No

When Clutter is brought to the front and it sees the iTunes Library.
xml file is updated, it reads the new file. Unfortunately it can take
several seconds for Foundation to parse the property list, and
Clutter's UI is locked up during this time.

The file should be parsed on a background thread. But we have to
be careful about how much to do on this thread, to avoid
concurrency problems. I think the background thread should ONLY
parse the plist into a dictionary; it should NOT access any of
Clutter's data model (the iTunes object or CD objects) since those
classes are not thread-safe. Fortunately the plist parsing is what
takes nearly all the time.

Discussion

  • Jens Miltner

    Jens Miltner - 2004-06-24

    Logged In: YES
    user_id=629488

    Are you sure it's really parsing the xml that takes long? There was a
    thread on macosxhints.com about speeding up clutter and it was a mere
    rearranging of the way to search for songs/albums/artists:

    http://www.macosxhints.com/article.php?story=20040430183813805

     
  • Anonymous

    Anonymous - 2004-06-24

    Logged In: YES
    user_id=1042909

    jmiltner: That script you linked to is addressing a different performance
    problem, which is the response time after telling Clutter to play an
    album. (And thanks a lot for forwarding that script! It should definitely be
    incorporated into the app.)
    The issue this bug covers is the lag when bringing Clutter to the front, and
    I have profiled it, and essentially all the time is spent in CoreFoundation
    code that parses plists.

     

Log in to post a comment.