Slow performance of adding MIDI Events to MusicTrack?

2009-12-08 Thread NickK
Hi all,
I've been working on a MIDI application and I'm just creating a test track of 
10,000,000 events spread over 46 notes. Once created the application stores the 
MusicSequence as a file. I traditionally use large data sets to ensure the 
applications are written to deliver fast processing and I've done it this time 
to ensure latency is kept to a minimum for MIDI.

The problem I have is that the MusicTrackNewMIDINoteEvent method is 
exceptionally slow - in the order of 30 minutes for adding 100,000 events. All 
the program is doing is 10M loops of adding note events into the MusicTrack.

I've sampled the application running and it spends 100% of it's time within 
std::vector operations - iterator and copy. So I'm assuming it adds the event 
by iterating through the entire current set until it finds the correct 
timestamp location and then makes a gap my copying the data before inserting it.

It seems a little barking mad for Apple to use a linear search routine and I 
would suspect a hashed based dense key storage system would have been better? 
This would slow down with more additions!

Is this a known issue that others have experienced?

I'm using SL, with the compilation running Release x86_64 in addition to 
auto-vec & SSE optimisations on a MBP3,1 2.4GHz with 4GB.

Warmest regards,
Nick.___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Slow performance of adding MIDI Events to MusicTrack?

2009-12-08 Thread NickK
Ok, I've submitted it as a performance bug to Apple. It's a quick win fix to be 
honest with a large effect on their MIDI users.

I should try a test using MIDIEndPoint attached to the MusicTrack to add the 
note events instead..

Nick

On 8 Dec 2009, at 14:59, Simone Tellini wrote:

> NickK ha scritto:
>> I've sampled the application running and it spends 100% of it's time within 
>> std::vector operations - iterator and copy. So I'm assuming it adds the 
>> event by iterating through the entire current set until it finds the correct 
>> timestamp location and then makes a gap my copying the data before inserting 
>> it.
>> 
>> It seems a little barking mad for Apple to use a linear search routine and I 
>> would suspect a hashed based dense key storage system would have been 
>> better? This would slow down with more additions!
>> 
>> Is this a known issue that others have experienced?
>>  
> yes, I've noticed the same thing.
> 
> Luckily, I've never had to add that many events/notes, so I could bear to 
> wait for some seconds.
> 
> -- 
> Simone Tellini
> http://www.tellini.org
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/cocoadev%40adrenalin-junkie.net
> 
> This email sent to cocoa...@adrenalin-junkie.net

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com