This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
binary_search, lower_bound and upper_bound inlining
- From: Dimitris Xochellis <jimxoch at yahoo dot gr>
- To: libstdc++ at gcc dot gnu dot org
- Date: Sun, 1 Apr 2007 17:07:37 +0100 (BST)
- Subject: binary_search, lower_bound and upper_bound inlining
Hello list,
I have recently discovered that the binary_search, lower_bound and upper_bound algorithms are not
declared inline in libstdc++ (at least not in the 3.3, 4.1, 4.2 GCC releases). Since this affects
negatively the performance of my code, I have modified the stl_algo.h file and declared inline the
above algorithms. The immediate result after the modification was a great performance improvement!
Subsequently, I have also discovered that the above change greatly improves the performance of the
Loki::AssocVector [1] lookups!
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?
Best regards
Jim Xochellis
References
1. http://loki-lib.sourceforge.net/html/a00025.html
___________________________________________________________
Χρησιμοποιείτε Yahoo!;
Βαρεθήκατε τα ενοχλητικά μηνύματα (spam); Το Yahoo! Mail
διαθέτει την καλύτερη δυνατή προστασία κατά των ενοχλητικών
μηνυμάτων http://login.yahoo.com/config/mail?.intl=gr