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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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 


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