* Peter Corlett ([EMAIL PROTECTED]) wrote:
> In article <[EMAIL PROTECTED]> you write:
> > ok, but it gets more interesting as take into account moores law that
> > reduces the effectiveness of optmisation by halving the improvement of the
> > optimization every year [...]
> This depends. If you're just doing an optimisation that changes one O(N)
> algorithm for another, then you're probably better off with the most clear
> version and wait for Moore's Law to help. Cycle-pinching optimisation
> doesn't really gain much anyway.
> [Mind you, I suspect that index and the equivalent regexen may have
> different O() scores. Discuss.]
> However, the problem is with programmers that don't really understand
> algorithms and implement something the "obvious" way, e.g. O(N^2) instead of
> O(NlogN) then this is not going to help when you attempt to scale your
> website or whatever to a million users instead of a test set of five.

the best way to do this, if you see something is N^2 is to figure out
how you could do it with a sort and hey presto it usually can be turned
into NlogN+N .. NlogN

Greg McCarroll                          http://www.mccarroll.uklinux.net

Reply via email to