https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125277
Bug ID: 125277
Summary: stable_sort should use insertion sort for sufficiently
small ranges
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: rs2740 at gmail dot com
Target Milestone: ---
For sufficiently small ranges, a plain insertion sort appears to perform better
than the temporary buffer + merge sort.
libc++'s stable_sort uses 128 as the threshold if the type is trivially copy
assignable and 0 otherwise. Their std::sort uses 24. MSVC uses 32. libstdc++'s
std::sort uses 16.