A C++ implementation of timsort
Hi everyone, this release marks a change of maintainers since Goro Fuji (gfx) couldn't take care of the project anymore. I didn't want to let this project go unmaintained so I offered to take care of it.
The interface of the algorithm remains the same as it was and still works with C++98 and newer C++ standards. However the tooling changed significantly, here is a brief list of overarching changes, which will be described with more detail later:
The following bugs were fixed:
mergeHi
: this sometimes caused issues with std::deque
or the MSVC STL debug iterators (issue #30).timsort
The following improvements were made to the code of timsort
:
mergeLo
and mergeHi
are faster and don't allocate extra memory anymore when one of the runs contains only one element.-Winline
with GCC.The following changes also affect timsort.hpp
:
GFX_TIMSORT_USE_STD_MOVE
can be defined to 0 or 1 to disable or enable move semantics support in gfx::timsort
. If this macro is not set, we try to enable move semantics when we detect compiler support.GFX_TIMSORT_ENABLE_LOG
is defined.GFX_TIMSORT_ENABLE_ASSERT
is defined (they previously always fired).gfx::timsort
function was placed in a pseudo-private gfx::detail::
namespace.The tooling was significantly changed prior to this release. One of the main changes was to remove the old project's Makefile
and to introduce CMake support instead:
INTERFACE
target gfx::timsort
.-DBUILD_TESTING=ON
and run as CTest tests.-DBUILD_BENCHMARKS=ON
.-DGFX_TIMSORT_USE_VALGRIND=ON
.-DGFX_TIMSORT_SANITIZE=<comma-separated-list-of-sanitizers>
.The tests were partly rewritten:
cxx_98_tests.cpp
and cxx_11_tests.cpp
which should be compiled with C++98 and C++11 respectively.The continuous integration was also revised:
Other miscellaneous changes:
examples/
was moved to benchmarks/
.This release marks the last commit from the original project before a change of tooling and architecture. After this release, the raw Makefile support will be replaced with CMake support, Boost.Test with Catch2, and the project structure will change a bit.
The algorithm interface itself will remain stable through the new releases: C++ code using gfx::timsort
should continue to work.