Skip to content
Merged

v2.1 #11

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
dfd7011
Lots of minor improvements. In the middle of hold_any refactoring.
May 22, 2026
8fe853d
The version 2.1 introduced additional breaking changes:
Thermadiag Jun 11, 2026
118bd1a
Added tsl hash maps for benchmarks
Thermadiag Jun 11, 2026
c310a57
gcc corrections
Jun 11, 2026
19c1df4
updated benchmarks
Jun 11, 2026
f105024
Added benchmark for sorted maps
Jun 12, 2026
b258514
Correction in concurrent_queue and its tests. updated bench_map_csv.
Thermadiag Jun 12, 2026
e5fb721
Added missing test file
Thermadiag Jun 12, 2026
f97fdb5
updated benchmark
Jun 12, 2026
718b541
Added sorted map benchmark. Updated documentation.
Jun 16, 2026
3c1ad03
Updated documentation
Jun 16, 2026
4b6176f
Updated documentation
Jun 16, 2026
eddf21e
Updated documentation
Jun 16, 2026
d3572b3
Test workflow
Jun 16, 2026
83eb93b
Correction for macosx/clang
Jun 16, 2026
e5ad148
Updated benchmark
Jun 16, 2026
18e42b9
Updated benchmark
Jun 16, 2026
ec8f495
updated benchmark
Jun 16, 2026
ffc5889
macosx/clang correction
Jun 16, 2026
46a5f07
updated benchmark
Jun 16, 2026
6c2594d
updated benchmark
Jun 16, 2026
a7ed354
Attempt to correct compile error when using seq::hasher with boost.un…
Thermadiag Jun 17, 2026
e53d173
updated benchmarks
Jun 17, 2026
abb5aa6
updated benchmark
Jun 17, 2026
ae71eb2
updated documentation
Thermadiag Jun 17, 2026
f882c92
updated documentation
Thermadiag Jun 17, 2026
1d8c7b4
updated documentation. Updated License date. Updated seq::hasher to w…
Thermadiag Jun 17, 2026
7b2124a
Updated documentation. Updated benchmark cmake file if openmp not found.
Thermadiag Jun 17, 2026
f037cf8
Added latency benchmark
Jun 18, 2026
bd66800
Updated benchmark
Jun 18, 2026
943ebfa
updated documentation
Jun 18, 2026
d2c79bd
updated documentation
Jun 18, 2026
680ff9f
updated documentation
Jun 18, 2026
1a198a6
updated documentation
Jun 18, 2026
f12b3cd
updated documentation
Jun 18, 2026
a3b6fd8
Added missing benchmark source code. updated radix tree documentation.
Jun 18, 2026
3f89811
Updated documentation
Jun 18, 2026
a712ed7
Updated documentation
Jun 18, 2026
3e83fbb
Updated documentation. Corrected benchmark.
Jun 18, 2026
4549433
Updated documentation.
Jun 18, 2026
f8bce8c
Updated documentation.
Jun 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: build
on:

push:
branches: [ "main", "v2dev" ]
branches: [ "main", "radix" ]
pull_request:
branches: [ "main", "v2dev", "releases/**" ]
branches: [ "main", "releases/**" ]
workflow_dispatch:
workflow_call:

Expand Down
12 changes: 7 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ set(SEQ_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/seq")
# create source file list
file(GLOB SeqSources
"seq/*.hpp"
"seq/internal/*.hpp"
)

add_library(seq INTERFACE ${SeqSources})
Expand Down Expand Up @@ -56,15 +57,16 @@ install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/seq"


# Configure and install seq.pc
configure_file(seq.pc.in seq.pc @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/seq.pc
configure_file(seq.pc.in ${CMAKE_BINARY_DIR}/seq.pc @ONLY)
install(FILES ${CMAKE_BINARY_DIR}/seq.pc
DESTINATION ${SEQ_INSTALL_DATAROOTDIR}/pkgconfig)


# Configure and install seq_config.hpp
configure_file(seq_config.hpp.in seq_config.hpp @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/seq_config.hpp
DESTINATION "${CMAKE_INSTALL_PREFIX}/include/seq")
configure_file(seq_config.hpp.in ${CMAKE_BINARY_DIR}/seq_config.hpp @ONLY)
install(FILES ${CMAKE_BINARY_DIR}/seq_config.hpp
DESTINATION "include/seq")


# Configure and install seqConfig.cmake and seqConfigVersion.cmake
include(CMakePackageConfigHelpers)
Expand Down
22 changes: 22 additions & 0 deletions LICENSES/MPMCQueue.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
The MIT License (MIT)

Copyright (c) 2018 Erik Rigtorp <erik@rigtorp.se>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

62 changes: 62 additions & 0 deletions LICENSES/modycamel.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
This license file applies to everything in this repository except that which
is explicitly annotated as being written by other authors, i.e. the Boost
queue (included in the benchmarks for comparison), Intel's TBB library (ditto),
dlib::pipe (ditto),
the CDSChecker tool (used for verification), the Relacy model checker (ditto),
and Jeff Preshing's semaphore implementation (used in the blocking queue) which
has a zlib license (embedded in lightweightsempahore.h).

---

Simplified BSD License:

Copyright (c) 2013-2016, Cameron Desrochers.
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

- Redistributions of source code must retain the above copyright notice, this list of
conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of
conditions and the following disclaimer in the documentation and/or other materials
provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

---

I have also chosen to dual-license under the Boost Software License as an alternative to
the Simplified BSD license above:

Boost Software License - Version 1.0 - August 17th, 2003

Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:

The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
40 changes: 28 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,20 @@
[![CTest](https://github.com/Thermadiag/seq/actions/workflows/build-macos.yml/badge.svg?branch=main)](https://github.com/Thermadiag/seq/actions/workflows/build-macos.yml)
[![CTest](https://github.com/Thermadiag/seq/actions/workflows/build-windows.yml/badge.svg?branch=main)](https://github.com/Thermadiag/seq/actions/workflows/build-windows.yml)

Transitioning to v2.0
For what it's worth, this library and its documentation were created without the help of AI.

Transitioning to v2.1
---------------------

*seq* v2.0 introduced a lot of changes. See this [note](docs/v2.md) for more details and explanations.
*seq* v2.1 introduced a lot of changes. See [changelog](docs/changelog.md) for more details and explanations.

Purpose
-------

The *seq* library is a header-only collection of original C++17 STL-like containers and related tools.

*seq* library does not try to reimplement already existing container classes present in other libraries like <a href="https://github.com/facebook/folly">folly</a>, <a href="https://abseil.io/">abseil</a>, <a href="https://www.boost.org/">boost</a> and (of course) std. Instead, it provides new features (or a combination of features) that are usually not present in other libraries. Some low level API like bits manipulation or hashing functions are not new, but must be defined to keep the seq library self dependent.
*seq* library does not try to reimplement already existing container classes present in other libraries like <a href="https://github.com/facebook/folly">folly</a>, <a href="https://abseil.io/">abseil</a>, <a href="https://www.boost.org/">boost</a> and (of course) std.
Instead, it provides new features (or a combination of features) that are usually not present in other libraries. Some low level API like bits manipulation or hashing functions are not new, but must be defined to keep the seq library self dependent.

Among other things (see modules below), the *seq* library defines several container classes as alternatives to STL containers or providing features not present in the STL.
These containers generally adhere to the properties of STL containers (in C++17 version), though there are often some associated API differences and/or implementation details which differ from the standard library.
Expand All @@ -23,7 +26,7 @@ The *seq* containers are not necessarly drop-in replacement for their STL counte

Currently, the *containers* module provide 5 types of containers:
- Sequential random-access containers:
- [seq::devector](docs/devector.md): double ended vector that optimized for front and back operations. Similar interface to `std::deque`.
- [seq::devector](docs/devector.md): double ended vector optimized for front AND back operations. Similar interface to `std::deque`.
- [seq::tiered_vector](docs/tiered_vector.md): tiered vector implementation optimized for fast insertion and deletion in the middle. Similar interface to `std::deque`.
- Sequential stable non random-access container: `seq::sequence`, fast stable list-like container.
- Sorted containers:
Expand All @@ -36,28 +39,26 @@ Currently, the *containers* module provide 5 types of containers:
- Hash tables:
- [seq::ordered_set](docs/ordered_set.md): Ordered robin-hood hash table with backward shift deletion. Drop-in replacement for `std::unordered_set` (except for the bucket and node interface) with iterator/reference stability, with performances close to 'flat' hash maps. `seq::ordered_set` preserves the insertion order.
- `seq::ordered_map`: associative version of `seq::ordered_set`.
- [seq::radix_hash_set](docs/radix_tree.md): radix based hash table with a similar interface to `std::unordered_set`. Uses incremental rehash (no memory peak) with a very small memory footprint.
- [seq::radix_hash_set](docs/radix_tree.md): radix based hash table with a similar interface to `std::unordered_set`. Uses incremental rehash (no memory peak), ideal when low memory footprint and low latency are required.
- `seq::radix_hash_map`: associative version of `seq::radix_hash_set`.
- [seq::concurrent_map](docs/concurrent_map.md) and `seq::concurrent_set`: higly scalable concurrent hash tables with interfaces similar to `boost::concurrent_flat_set/map`.
- Strings:
- [seq::tiny_string](docs/tiny_string.md): relocatable string-like class with configurable Small String Optimization and tiny memory footprint. Makes most string containers faster.

- Other:
- [seq::concurrent_queue](docs/concurrent_queue.md): fast thread-safe queue designed for Multi-Producer Multi-Consumer (MPMC) scenarios.

Content
-------

The library is divided in 7 small modules:
The library is divided in 5 small modules:
- [bits](docs/bits.md): low-level bits manipulation utilities
- [hash](docs/hash.md): tiny hashing framework
- [charconv](docs/charconv.md): fast arithmetic to/from string conversion
- [format](docs/format.md): fast and type safe formatting tools
- [containers](docs/containers.md): main module, collection of original containers: double ended vector, tiered-vector, ordered hash map, flat map based on tiered-vector, compressed vector...
- [any](docs/any.md): type-erasing polymorphic object wrapper used to build heterogeneous containers, including hash tables and sorted containers.
- [algorithm](docs/algorithm.md): a (small) collection of algorithm include the `net_sort` stable sorting algorithm.

A cmake project is provided for installation and compilation of tests/benchmarks.

*seq* library was tested with gcc 10.1.0 and 13.2.0 (Windows and Linux), msvc 19.43 (Windows), ClangCL 12.0.0 (Windows).

Design
------
Expand All @@ -83,6 +84,18 @@ Currently, the following options are provided:
- SEQ_BUILD_TESTS(OFF): build all tests
- SEQ_BUILD_BENCHS(OFF): build all benchmarks

It is also possible to directly copy/paste the *seq* folder into your project, while slightly dirty :).


Benchmarks
----------

The library provides several (small) benchmarks and more will be added:
- Benchmark of [concurrent hash tables](docs/concurrent_map.md) at the end of the page. Its goal is to compare `seq::concurrent_set/map` to other implementations.
- Benchmark on [sorted containers](docs/sorted_benchmark.md). Its goal is to compare `seq::flat_set/map` and `seq::radix_set/map` to other implementations.
- Very tiny benchmark on [concurrent queues](docs/concurrent_queue.md) to compare `seq::concurrent_queue` with other implementations.
- [Memory and latency benchmark](docs/latency_benchmark.md) on hash tables to compare `seq::radix_hash_set/map` with other implementations.


Acknowledgements
----------------
Expand All @@ -94,11 +107,14 @@ The `net_sort` stable sorting algorithm uses several ideas originaly coming (I t
Benchmarks (in `seq/benchs`) compare the performances of the *seq* library with other great libraries that I use in personnal or professional projects:
- <a href="https://plflib.org/">plf</a>: used for the plf::colony container,
- <a href="https://github.com/greg7mdp/gtl">gtl</a>: used for its gtl::btree_set and gtl::parallel_flat_hash_map,
- <a href="https://www.boost.org/">boost</a>: used for boost::flat_set, boost::unordered_flat_set and boost::concurrent_flat_map,
- <a href="https://www.boost.org/">boost</a>: used for boost::flat_set, boost::unordered_flat_set, boost::concurrent_flat_map, boost::lockfree::queue,
- <a href="https://github.com/martinus/unordered_dense">unordered_dense</a>: used for ankerl::unordered_dense::set,
- <a href="https://github.com/oneapi-src/oneTBB">TBB</a>: used for tbb::concurrent_unordered_map and tbb::concurrent_hash_map.
- <a href="https://github.com/Tessil">TSL</a>: numerous Tessil's hash tables.
- <a href="https://github.com/cameron314/concurrentqueue">Modycamel</a>: used for its MPMC concurrent queue.
- <a href="https://github.com/rigtorp/MPMCQueue">MPMCQueue</a>: Rigtorp's MPMC concurrent queue.

Some of these libraries are included in the `seq/benchs` folder.


seq:: library and this page Copyright (c) 2025, Victor Moncada
seq:: library and this page Copyright (c) 2026, Victor Moncada
13 changes: 10 additions & 3 deletions benchs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@ enable_testing()
# create the testing file and list of tests
create_test_sourcelist (Benchs
seq_benchs.cpp
bench_format.cpp
bench_hash.cpp
bench_concurrent_hash.cpp
bench_map.cpp
bench_map_csv.cpp
bench_sequence.cpp
bench_text_stream.cpp
bench_tiered_vector.cpp
bench_tiny_string.cpp
bench_boost_unordered_benchmarks.cpp
#bench_boost_unordered_benchmarks.cpp
bench_sort.cpp
bench_concurrent_queue.cpp
bench_hash_latency.cpp
)

# add the executable
Expand Down Expand Up @@ -60,6 +61,12 @@ if(TEST_BOOST_INSERT_ERASE)
target_compile_definitions(seq_benchs PRIVATE -DTEST_BOOST_INSERT_ERASE)
endif()


find_package(OpenMP )
if(${OpenMP_FOUND})
target_link_libraries(seq_benchs PRIVATE OpenMP::OpenMP_CXX)
endif()

# msvc warnings generated by seq_benchs.cpp
target_compile_definitions(seq_benchs PRIVATE -D_CRT_SECURE_NO_WARNINGS)

Expand Down
Loading
Loading