LWN.net Logo

Quotes of the week

Quotes of the week

Posted Aug 23, 2012 7:12 UTC (Thu) by dvdeug (subscriber, #10998)
In reply to: Quotes of the week by pr1268
Parent article: Quotes of the week

If I'm looking at code that hasn't been rewritten in the past ten years, then of course the compiler is smarter then the human programmer. Even assuming that we can ignore everything but the most common desktop processor, the first AMD64 chips weren't out yet, so they had to inline based on x86, CPUs that had eight general purpose registers. The cost-benefit ratios are totally different on AMD64 then they are on x86, and if you happen to compile on ARM, MIPS, PowerPC, SPARC or any other chip, the tradeoffs there are going to be different. Unless you're thinking in assembly, the compiler knows the tradeoffs better then you, and even then you probably win only on the system you were thinking of.


(Log in to post comments)

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