Reading iTunes library blocks app for several seconds
Status: Alpha
Brought to you by:
pellucidity
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.
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
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.