Re: Fastest way to replace characters in string
Re: Fastest way to replace characters in string
- Subject: Re: Fastest way to replace characters in string
- From: Alex Zavatone <email@hidden>
- Date: Fri, 23 Aug 2013 09:40:57 -0400
On Aug 22, 2013, at 2:05 PM, Thomas Wetmore wrote:
> Steve,
>
> Sorry, again I was unclear. Here is what I am trying to say:
>
> Pre-allocation means to allocate space before you need it, which would be at init time.
>
> But there is no need to pre-allocate -- the first allocation can be postponed until the first item is put in the container or characters in the string.
Why isn't it a good idea to have everything set up before you need it?
In my reasoning, If there is downtime when items can be set up of prefetched before they are needed, then they are ready for use when needed.
If you don't do that, then there is some delay when you need the items that is handled ahead of time, resulting in a delay before the items are available for use or displayed to the user.
Of course, this implied lazy instantiation and with it, I wonder why lazy instantiation is so big. If we're focused on performance, doesn't it make sense to have the items ready before we need them?
Sure, I use lazy instantiation at times as well, but I'm rather curious as to why this is such a preferred method.
_______________________________________________
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