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