This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: New attribute "infrequent"?
- To: Jan Hubicka <jh at suse dot cz>, gcc at gcc dot gnu dot org
- Subject: Re: New attribute "infrequent"?
- From: Frank Klemm <pfk at fuchs dot offl dot uni-jena dot de>
- Date: Sat, 1 Sep 2001 17:38:09 +0200
- >Received: (from pfk@localhost)by fuchs.offl.uni-jena.de (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id RAA04427;Sat, 1 Sep 2001 17:38:09 +0200
- References: <20010827174751.G11402@atrey.karlin.mff.cuni.cz>
I would not use a simple attribute but an attribute with a number which
contains the frequency the function is used.
For functions which are used a precise number this is the count of usages
(for instance 0, 1, 2, 4) or periodically called functions this is the call
frequency (for instance in calls/minute). So you have an attribute to say:
- normally this function is never used frequency(0) \
- normally this function is used once frequency(1) | *1
- normally this function is used twice frequency(2) |
- function is called 6 times per minute frequency(6) /
- function is used once per second frequency(60) - *2
- function is used 1000 times per second frequency(60000) - *3
- function is used 10^6 times per second frequency(60000000) - *4
- I don't know anything -
This is also much more usable for profiling.
I would avoid such fuzzy stuff like infrequent or frequent.
20 programmers and 21 opinions about what this means.
*1 heavily optimize for size, use also nasty tricks which slows down code significantly
*2 optimize for size
*3 optimize for speed
*4 heavily optimize for speed, maybe using different code for different CPUs
(like the icc), inline as much as you can!
--
Frank Klemm