Not logged in
Log in now
Create an account
Subscribe to LWN
LWN.net Weekly Edition for May 23, 2013
An "enum" for Python 3
An unexpected perf feature
LWN.net Weekly Edition for May 16, 2013
A look at the PyPy 2.0 release
The compiler is your friend
Posted Aug 30, 2012 0:10 UTC (Thu) by man_ls (subscriber, #15091)
From my remote days as a C developer I remember that there was an insane pleasure in trying to optimize every little bit out of the tools, but nowadays it makes less sense than ever, what with smart compilers and link time optimizations and branch prediction and steady improvements in processors every couple of years. Specially in the Linux kernel, targeting ARM SoC's and 32-processor boxes with the same code, and having to maintain it for decades, it is really hard to see the point to inline by hand.
Posted Aug 30, 2012 13:41 UTC (Thu) by epa (subscriber, #39769)
Obviously, whether to inline a function would have to be considered separately for each processor family.
Posted Aug 30, 2012 15:14 UTC (Thu) by viro (subscriber, #7872)
So no, you can't just trust the compiler to DTRT, since for most of its users the right thing is seriously different. We are overusing inline, no arguments about that, but it's not as simple as "just let the compiler choose".
Posted Sep 5, 2012 15:32 UTC (Wed) by epa (subscriber, #39769)
Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds