User: Password:
|
|
Subscribe / Log in / New account

Sometimes performance is not the main factor

Sometimes performance is not the main factor

Posted Oct 22, 2009 0:17 UTC (Thu) by nix (subscriber, #2304)
In reply to: Sometimes performance is not the main factor by felixrabe
Parent article: KS2009: Performance regressions

That teaches it one peephole optimization, as a solid lump that can't be
split up or scheduled (as that would probably lose whatever property you
were trying to tell it). A likely loss.

(And, er, also, most optimizations can't be expressed usefully in source
code, and those that can are much too complicated to express by handing it
two hunks and saying 'this one is optimized'. The only property this could
usefully impart is trivial code motion optimizations, and those are
*transformations on graphs*, not a straight replacement of one lump of
source code with another.)

Now in some languages you *can* do something like this: start with
something non-optimized and prove to the compiler that it can transform it
into something optimized, and it can do that henceforward to all similar
constructs it encounters. But the 'something' is not going to be a lump of
C. Even Haskell's not really expressive enough for this sort of thing to
work, and doing it is *not* simple.


(Log in to post comments)


Copyright © 2018, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds