Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

QTSampleTable Really Slow



Hi All-

I've been developing a new Movie Import component. Wanting to make the component able to deal with 64-bit timing, I started using the new QTSampleTable APIs instead of the old-style AddMediaSampleRef APIs. The basic loop I use is:

QTSampleTableCreateMutable

QTSampleTableAddSampleReferences for each sample

AddSampleTableToMedia

QTSampleTableRelease

The problem I ran into is that for large sets of samples (>10000), everything gets incredibly slow. After running through Shark, I noticed that about 95% of my the time was being spent doing memory opertations (memcpy, malloc, etc.) by QTSampleTableAddSampleReferences. What seems to be happening is that QTSampleTable is not making the table big enough, so when I add a sample the table often needs to reallocate itself to be larger, then copy over the old table. This is a really bad situation, because it essentially makes adding a lot of samples an O(n^2) operation.

Is there some way to speed this up? I noticed QTSampleTableCreateMutable() has a "hints" which is currently documented as "reserved". Is there some secret way to pass an expected sample count here so that the sample table can properly pre- allocate itself?

-Henry



_______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-API mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quicktime-api/email@hidden

This email sent to email@hidden
References: 
 >Change output device (From: LtSolo <email@hidden>)
 >Re: Change output device (From: Brad Ford <email@hidden>)
 >Re: Change output device (From: LtSolo <email@hidden>)
 >Re: Change output device (From: Brad Ford <email@hidden>)
 >Re: Change output device (From: LtSolo <email@hidden>)
 >Re: Change output device (From: Brad Ford <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.