Re: Performance problem with GC enabled
Re: Performance problem with GC enabled
- Subject: Re: Performance problem with GC enabled
- From: John Engelhart <email@hidden>
- Date: Fri, 13 Mar 2009 19:47:50 -0400
On Thu, Mar 12, 2009 at 3:17 PM, Peter Ammon <email@hidden> wrote:
>
> Hi John,
>
> Instead of storing each string individually into the heap, try batching up,
> say, 1k or so into a stack allocated buffer. Then use
> objc_memmove_collectable() to move them in bulk into the heap at the point
> your stack allocated buffer gets full, or your scan finishes.
>
I actually did give this a shot, or something close to it. I tried
using just the stack (swapping NSAllocateCollectable() with alloca()),
but no joy- exactly the same times came out. Good call though.
The problem is objc_assign_strongCast(), which surprisingly doesn't
seem to have a 'fast path' escape if it detects a write to an address
on the stack. I would have figured that at least the main threads
stack bounds would have been accounted for (I would be surprised if
this wasn't immutable once the linker handed off execution to the
program), as this really amounts to nothing more than a >= <= check,
but nope.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden