Re: Mutable arrays
Re: Mutable arrays
- Subject: Re: Mutable arrays
- From: "Michael Ash" <email@hidden>
- Date: Mon, 20 Oct 2008 17:59:01 -0400
On Mon, Oct 20, 2008 at 10:40 AM, <email@hidden> wrote:
>
> Michael Ash wrote on 20/10/2008 15:31:01:
>> And don't forget step 0:
>>
>> 0) Don't even bother
>>
>> A lot of people optimize code that's already plenty fast. A lot of
>> people optimize code that *hasn't even been written yet*. This is
>> foolish. Write your code to be easy to understand and as bug-free as
>> you can get it. And then, only if it's not running as fast as you need
>> it to, should you even start to consider the possibility of thinking
>> about beginning to investigate optimizing the code.
>
> I think that's only frequently, not usually or always, the approach to take.
> For instance if you have a specific performance requirement, and when you
> prototype the proposed solution you find the performance to be way off the
> requirement, it's best to go back to the boxes on the paper. Even
> Instruments is unlikely to help you get your slow design orders of magnitude
> faster, nor your bloated design orders of magnitude more svelt.
>
> I've been involved on a project like that in a previous job, where we had a
> requirement to process thousands of things/sec and our existing solution was
> capable of tens/sec. Rather than see what we could eke out of our solution,
> we went back to the whiteboard and optimised the design. In that case, this
> was not a foolish thing to do.
Definitely usually. The vast majority of code simply isn't performance
critical. When looking at either LOC or time spent, most of it doesn't
need to worry about performance at all. Furthermore, this sort of
"optimization" usually refers to code-level micro optimizations, not
big design decisions, particularly in the context of this thread.
I'm not against optimization. Far from it, in fact: you get the best
results by concentrating your effort where it does the most good. And
than means ignoring speed in most of your code.
Mike
_______________________________________________
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