This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: New attribute "infrequent"?


Linus writes:

> Almost always, the programmer knows which parts of his programs are
> really performance-critical.  Having him/her mark _those_ parts (as
> opposed to the bulk of his program) makes much more sense than trying to
> say "this should be optimized for size" all over the place. 

I agree that a "frequent" directive is better than an "infrequent"
directive, because there is a lot less code in the former category.

But in my experience, except for applications like DSP where control flow is
extremely predictable, most programmers (as opposed to gurus, and even
gurus are imperfect) tend NOT to know, or to guess wrong, about the
performance-critical parts of their program, unless they've profiled it.
Originally Fortran had a FREQUENCY statement.  While I can't find definite
confirmation, the widely reported story is that IBM implemented it
backwards in their Fortran II compiler, and no one noticed for quite some
time.  So it got dropped.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]