On 10/30/05, Laurence Harris <email@hidden> wrote:
> On 10/30/05 1:28 AM, Lawrence Sanbourne didst favor us with:
>
> >> A few thoughts:
> >>
> >> - The CFArray approach doesn't seem very efficient since for each directory
> >> you add to the array you have to create a CFDataRef, and then later in the
> >> same function reverse the process by calling CFDataGetBytes.
> >
> > This is my way of copying the FSRefs. I have to copy them instead of
> > storing their memory addresses because they are in the array, which I
> > keep reusing during the loop. This was the cause of the error I wrote
> > to carbon-dev about originally.
>
> I had a feeling it might be something like that, which is why I originally
> suggested using something that didn't involve CF.
Do the STL stacks, vectors, and other collections automatically copy
the memory referenced by a pointer? This would surprise me.
> > The STL is software, just as Core Foundation is.
>
> True, but what evidence do you have that CF is faster?
I know CF is "faster" only in that I don't have to rewrite anything!
> In any case, don't
> get fixated on STL. If you don't like or want to use STL, that's fine. It
> would be simple enough to write code for an efficient stack that would do
> the same thing. You're just storing a bunch of 80-byte structs. Nothing is
> going to be more efficient than copying them to or reading from slots in an
> array.
>
> My code:
>
> folderStack.push_back( fsRefArray[ idx ] );
This code (internally) still has to allocate some new memory, use copy
the stuff at the FSRef * to it.
So, I'm well aware of the convenience of the STL, but I have no reason
to believe it's faster than CF.
Larry
--
Larry Sanbourne
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden
This email sent to email@hidden