binary_search, lower_bound and upper_bound inlining

Dimitris Xochellis jimxoch@yahoo.gr
Sun Apr 1 16:07:00 GMT 2007


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 



More information about the Libstdc++ mailing list