{"id":24620245,"url":"https://github.com/thermadiag/seq","last_synced_at":"2025-05-07T10:06:38.382Z","repository":{"id":153749649,"uuid":"531027804","full_name":"Thermadiag/seq","owner":"Thermadiag","description":"The seq library is a collection of original C++14 STL-like containers and related tools","archived":false,"fork":false,"pushed_at":"2024-09-30T14:25:27.000Z","size":26474,"stargazers_count":88,"open_issues_count":2,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-07T10:06:05.403Z","etag":null,"topics":["c-plus-plus","compression","concurrent-data-structure","cpp","cpp11","data-structures","formatting","hashmap","hashtable","radix"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Thermadiag.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-08-31T10:06:03.000Z","updated_at":"2025-04-11T18:14:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"73c0a9ac-a6bb-4179-bc7e-3cd8e62d25c0","html_url":"https://github.com/Thermadiag/seq","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thermadiag%2Fseq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thermadiag%2Fseq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thermadiag%2Fseq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thermadiag%2Fseq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Thermadiag","download_url":"https://codeload.github.com/Thermadiag/seq/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252856554,"owners_count":21814858,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c-plus-plus","compression","concurrent-data-structure","cpp","cpp11","data-structures","formatting","hashmap","hashtable","radix"],"created_at":"2025-01-25T01:26:09.820Z","updated_at":"2025-05-07T10:06:38.368Z","avatar_url":"https://github.com/Thermadiag.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CTest](https://github.com/Thermadiag/seq/actions/workflows/cmake.yml/badge.svg?branch=master)](https://github.com/Thermadiag/seq/actions/workflows/cmake.yml)\n\n\nPurpose\n-------\n\nThe *seq* library is a collection of original C++14 STL-like containers and related tools.\n\n*seq* library does not try to reimplement already existing container classes present in other libraries like \u003ca href=\"https://github.com/facebook/folly\"\u003efolly\u003c/a\u003e, \u003ca href=\"https://abseil.io/\"\u003eabseil\u003c/a\u003e, \u003ca href=\"https://www.boost.org/\"\u003eboost\u003c/a\u003e 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.\n\nAmong 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.\nThese 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.\n\nThe *seq* containers are not necessarly drop-in replacement for their STL counterparts as they usually provide different iterator/reference statibility rules or different exception guarantees.\n\nCurrently, the *containers* module provide 5 types of containers:\n-\tSequential random-access containers: \n\t-\t[seq::devector](docs/devector.md): double ended vector that can be optimized for front operations, back operations or both. Similar interface to `std::deque`.\n\t-\t[seq::tiered_vector](docs/tiered_vector.md): tiered vector implementation optimized for fast insertion and deletion in the middle. Similar interface to `std::deque`.\n\t-\t[seq::cvector](docs/cvector.md): vector-like class storing its values in a compressed way to reduce program memory footprint. Similar interface to `std::vector`.\n-\tSequential stable non random-access container: `seq::sequence`, fast stable list-like container.\n-\tSorted containers: \n\t-\t[seq::flat_set](docs/flat_set.md) : flat set container similar to boost::flat_set but based on seq::tiered_vector and providing fast insertion/deletion of single elements.\n\t-\t`seq::flat_map`: associative version of `seq::flat_set`.\n\t-\t`seq::flat_multiset`: similar to `seq::flat_set` but supporting duplicate keys.\n\t-\t`seq::flat_multimap`: similar to `seq::flat_map` but supporting duplicate keys.\n\t-\t[seq::radix_set](docs/radix_tree.md) : radix based sorted container with a similar interface to std::set. Provides very fast lookup.\n\t-\t`seq::radix_map`: associative version of `seq::radix_set`.\n-\tHash tables: \n\t-\t[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 interface) with iterator/reference stability, and additional features (see class documentation).\n\t-\t`seq::ordered_map`: associative version of `seq::ordered_set`.\n\t-\t[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.\n\t-\t`seq::radix_hash_map`: associative version of `seq::radix_hash_set`.\n\t-\t[seq::concurrent_map](docs/concurrent_map.md) and `seq::concurrent_set`: higly scalable concurrent hash tables.\n-\tStrings:\n\t-\t[seq::tiny_string](docs/tiny_string.md): string-like class with configurable Small String Optimization and tiny memory footprint. Makes most string containers faster.\n\n\nContent\n-------\n\nThe library is divided in 6 small modules:\n-\t[bits](docs/bits.md): low-level bits manipulation utilities\n-\t[hash](docs/hash.md): tiny hashing framework\n-\t[charconv](docs/charconv.md): fast arithmetic to/from string conversion\n-\t[format](docs/format.md): fast and type safe formatting tools\n-\t[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...\n-\t[any](docs/any.md): type-erasing polymorphic object wrapper used to build heterogeneous containers, including hash tables and sorted containers.\n\nA cmake project is provided for installation and compilation of tests/benchmarks.\n\nWhy C++14 ?\n-----------\n\nFor now the *seq* library is developped and maintained in order to remain compatible with C++14 only compilers.\nWhile C++17 and C++20 are now widely supported by the main compilers (namely msvc, gcc and clang), I often have to work on constrained and old environments (mostly on Linux) where the compiler cannot be upgraded. At least they (almost) all support C++14.\n\nFor instance, the [charconv](docs/charconv.md) and [format](docs/format.md) modules were developped because C++11 only compilers do not provide similar functionalities. They still provide their own specifities for more recent compilers.\n\n*seq* library was tested with gcc/10.1.0, gcc/13.2.0 (Windows, mingw), gcc/8.4.0 (Linux), gcc/6.4.0 (Linux), msvc/19.29 (Windows), ClangCL/12.0.0 (Windows).\n\nDesign\n------\n\n*seq* library is a small collection of self dependant components. There is no restriction on internal dependencies, and a seq component can use any number of other components. For instance, almost all modules rely on the [bits](docs/bits.md) one.\n\nAll classes and functions are defined in the `seq` namespace, and names are lower case with underscore separators, much like the STL.\nMacro names are upper case and start with the `SEQ_` prefix.\n\nThe directory structure is flat and use the \"stuttering\" scheme `seq/seq` used by many other libraries like boost.\nIncluding a file has the following syntax: `#include \u003cseq/tiered_vector.hpp\u003e`\n\nThe `seq/tests` subdirectory includes tests for all components, usually named `test_modulename.cpp`, and rely on CTest (shipped with CMake). The tests try to cover as much features as possible, *but bugs might still be present*. Do not hesitate to contact me if you discover something unusual.\nThe `seq/benchs` subdirectory includes benchmarks for some components, usually named `bench_modulename.cpp`, and rely on CTest. The benchmarks are performed against other libraries that are provided in the 'benchs' folder.\n\nBuild\n-----\n\nThe *seq* library requires compilation using cmake, but you can still use it without compilation by using `-DHEADER_ONLY=ON`. \nEven in header-only mode, you should use the cmake file for installation.\n\nCurrently, the following options are provided:\n\n-\tSEQ_ENABLE_AVX2(ON): enable AVX2 support, usefull (but not mandatory) for `seq::radix_(map/set/hash_map/hash_set)` as well as `seq::cvector`\n-\tSEQ_BUILD_TESTS(OFF): build all tests\n-\tSEQ_BUILD_BENCHS(OFF): build all benchmarks\n-\tSEQ_TEST_CVECTOR(ON): if building tests, add the `seq::cvector` class tests\n-\tSEQ_BUILD_SHARED(ON): build the shared version of seq library\n-\tSEQ_BUILD_STATIC(ON): build the static version of seq library\n\nNote that for msvc build, AVX2 support is enabled by default. You should call cmake with `-DSEQ_ENABLE_AVX2=OFF` to disable it.\n\nUsing Seq library with CMake\n----------------------------\n\nThis [cmake example](tests/test_cmake/CMakeLists.txt) shows how to use the *seq* library within a cmake project. It creates 3 targets using the shared seq library, the static one, and the header only mode.\n\n\nAcknowledgements\n----------------\n\nThe only library dependency is \u003ca href=\"https://github.com/orlp/pdqsort\"\u003epdqsort\u003c/a\u003e from Orson Peters. The header `pdqsort.hpp` is included within the *seq* library.\n*seq* library also uses a modified version \u003ca href=\"https://github.com/lz4/lz4\"\u003eLZ4\u003c/a\u003e that could be used with `cvector` class.\nFinaly, *seq* library uses a simplified version of the [komihash](https://github.com/avaneev/komihash) hash function for its hashing framework.\n\nBenchmarks (in `seq/benchs`) compare the performances of the *seq* library with other great libraries that I use in personnal or professional projects:\n-\t\u003ca href=\"https://plflib.org/\"\u003eplf\u003c/a\u003e: used for the plf::colony container,\n-\t\u003ca href=\"https://github.com/greg7mdp/gtl\"\u003egtl\u003c/a\u003e: used for its gtl::btree_set and gtl::parallel_flat_hash_map,\n-\t\u003ca href=\"https://www.boost.org/\"\u003eboost\u003c/a\u003e: used for boost::flat_set, boost::unordered_flat_set and boost::concurrent_flat_map,\n-\t\u003ca href=\"https://github.com/martinus/unordered_dense\"\u003eunordered_dense\u003c/a\u003e: used for ankerl::unordered_dense::set,\n-\t\u003ca href=\"https://github.com/oneapi-src/oneTBB\"\u003eTBB\u003c/a\u003e: used for tbb::concurrent_unordered_map and tbb::concurrent_hash_map.\n\nSome of these libraries are included in the `seq/benchs` folder.\n\n\nseq:: library and this page Copyright (c) 2023, Victor Moncada\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthermadiag%2Fseq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthermadiag%2Fseq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthermadiag%2Fseq/lists"}