gcc/libstdc++-v3/include
Marc Glisse 465520e3eb libstdc++: std::includes performance tweak
A small tweak to the implementation of __includes, which in my
application saves 20% of the running time. I noticed it because using
range-v3 was giving unexpected performance gains.

Some of the gain comes from pulling the 2 calls ++__first1 out of the
condition so there is just one call. And most of the gain comes from
replacing the resulting

if (__comp(__first1, __first2))
  ;
else
  ++__first2;

with

if (!__comp(__first1, __first2))
  ++__first2;

I was very surprised that the code ended up being so different for such
a change, and I still don't really understand where the extra time is
going...

Anyway, while I blame the compiler for not generating very good code
with the current implementation, I believe the change can be seen as a
simplification.

libstdc++-v3/ChangeLog:

	* include/bits/stl_algo.h (__includes): Simplify the code.
2020-06-19 13:03:45 +01:00
..
backward
bits libstdc++: std::includes performance tweak 2020-06-19 13:03:45 +01:00
c
c_compatibility
c_global
c_std
debug libstdc++: Extend memcmp optimization in std::lexicographical_compare 2020-06-10 17:48:56 +01:00
decimal
experimental libstdc++: Refactor filesystem::path string conversions 2020-05-23 09:40:16 +01:00
ext libstdc++: Avoid errors in allocator's noexcept-specifier (PR 89510) 2020-04-30 16:01:43 +01:00
parallel libstdc++: Fix some C++20 algorithms to work in parallel mode 2020-05-07 21:43:49 +01:00
precompiled
pstl
std libstdc++: Optimize std::optional default constructor 2020-06-19 12:15:43 +01:00
tr1
tr2
Makefile.am
Makefile.in