Performance improvements

Discuss the development and future direction of Play.
Post Reply
User avatar
sbooth
Site Admin
Posts: 2445
Joined: Fri Dec 23, 2005 7:45 am
Location: USA
Contact:

Performance improvements

Post by sbooth » Thu Feb 01, 2007 12:07 am

I've done some investigation into Play's performance, which, in the current version, is abominable. As best I can tell the slowdown is caused by the thousands (or more) Objective-C messages that come as part of Core Data and Cocoa Bindings on application startup as Play populates the UI. I perform pre-fetching and batch faulting, and I've determined that the performance hit is not coming from Core Data per se, but rather through the innumerable valueForKey: calls that come from the UI bindings.

I coded a test program using the latest version of sqlite directly. I was able to cobble together a window to which you can add MP3 files and create playlists. As a test I added 5,053 MP3 files to the "library" and it took 27.74 seconds. I'm using the term library loosely here because in the sample app a library is just a window that displays the streams and some of their metadata. But it any case, 27.74 seconds for 5,053 adds is quite an improvement. I think adding the same 5000 files to Play takes over 20 minutes.

So, I'll be switching from Core Data to sqlite for this application, purely for the performance enhancements I can realize.

User avatar
krmathis
Posts: 233
Joined: Thu Feb 02, 2006 11:05 am
Location: Oslo, Norway

Post by krmathis » Wed Feb 07, 2007 8:49 pm

Great work!
Its noticeable faster for me, when adding Apple Lossless files to Play.

But I noticed one difference to the old system.
Add lots of files to Play at once, and it seems like its gone into a hang. Beach balling continuously until all files are added, and no sign of any files in Play. While the previous version add one file at a time in the main window as they are written into the database, and display the file number accordingly in the lower right.
Regression or feature?

User avatar
sbooth
Site Admin
Posts: 2445
Joined: Fri Dec 23, 2005 7:45 am
Location: USA
Contact:

Post by sbooth » Thu Feb 08, 2007 8:57 pm

krmathis wrote:Regression or feature?
Probably neither :) I plan on adding some sort of progress/activity indicator, but haven't gotten to it yet.

User avatar
krmathis
Posts: 233
Joined: Thu Feb 02, 2006 11:05 am
Location: Oslo, Norway

Post by krmathis » Sat Feb 10, 2007 5:57 pm

sbooth wrote:
krmathis wrote:Regression or feature?
Probably neither :) I plan on adding some sort of progress/activity indicator, but haven't gotten to it yet.
Thanks! No I know that you are aware of the problem, and have plans to fix it...

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest