Re: are static operations optimized?
Re: are static operations optimized?
- Subject: Re: are static operations optimized?
- From: Michael Crawford <email@hidden>
- Date: Tue, 27 Jan 2009 10:24:27 -0800
> I share the opinion of most experts when I say: please spend your mental
> cycles on creating a solid data and code architecture and let the tools do
> what they do best. Every minute spent worrying about how to optimize an
> operation would be better spent figuring out an architecture that didn't
> require the operation in the first place.
People say this to me all the time, but I have never met an optimizer
I couldn't beat - and significantly so - by writing better code.
Judicious use of a profiler helps, in one case I used the Intel VTune
Performance Analyzer for a solid month to tune up a C++ database
kernel.
If you wonder how this can be, consider that there are things that an
optimizer cannot optimize. If you do something stupid in your code,
the best an optimizer can do is to accomplish that stupidity in the
fastest way possible.
The usual example given is to choose a better algorithm, for example a
binary search instead of a linear search. Of course that's correct -
but it's not what I'm referring to; I'm referring to tight code.
I have been paid to write code for twenty-one years now, and I have
used all manner of compilers on all manner of platforms to generate
code for all manner of processors - and never have I found even a
single optimizer that I can't beat by tightening up my code.
Mike
--
Michael David Crawford
mdcrawford at gmail dot com
I'm looking for a job in Silicon Valley:
http://www.goingware.com/resume/cover-letter.html
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden