This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: binary_search, lower_bound and upper_bound inlining
- From: Paolo Carlini <pcarlini at suse dot de>
- To: Dimitris Xochellis <jimxoch at yahoo dot gr>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Sun, 01 Apr 2007 18:18:47 +0200
- Subject: Re: binary_search, lower_bound and upper_bound inlining
- References: <445904.40822.qm@web23103.mail.ird.yahoo.com>
Hi Dimitris,
Is there something that I can do, other than editing the stl_algo.h file, in order to persuade the
compiler to inline the binary_search, lower_bound and upper_bound algorithms? (even -O3 seems not
good enough). Any chance for these algorithms to be inlined in the future GCC releases?
we can definitely mark inline binary_search, very tiny, but frankly, for
general use lower_bound and upper_bound seem too big and we risk a bad
code bloat. Can you measure a small improvement for binary_search alone?
In general, anyway, you should refer to the gcc manual, there are
various knobs you can turn in order to change the behavior of the
inliner (-finline-limit=...)
Paolo.