Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gutjuri/tries
Tries in C++
https://github.com/gutjuri/tries
Last synced: 2 months ago
JSON representation
Tries in C++
- Host: GitHub
- URL: https://github.com/gutjuri/tries
- Owner: gutjuri
- License: gpl-2.0
- Created: 2020-06-29T17:16:35.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-08-20T09:17:47.000Z (over 4 years ago)
- Last Synced: 2024-01-28T23:12:02.835Z (12 months ago)
- Language: C++
- Size: 1.44 MB
- Stars: 10
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# tries
Tries in C++
## Directory structure
* benchmark contains benchmark results.
* catch2 contains the library used for testing
* res contains benchmark data
* trie.hpp is the main header file
* test.cpp and testcases.cpp contain test cases
* benchmark-trie.cpp contains benchmark cases## Usage & Requirements
This work is licensed under GNU-GPL 2.0; see [LICENSE.txt](LICENSE.txt) for more information.
### Usage only
Since this is a header-only library, it is enough to include trie.hpp into the file you want to use tries in!
A C++20 compliant compiler is needed.
I confirmed that gcc 10.0.1 and 10.1.0 work; Clang doesn't seem to work (at least in version 10.0.0).### Tests
In order to execute tests, the dependency catch2 must be available under catch2/catch.hpp.
The tests can be executed with `make unittests`.### Benchmarks
In order to execute benchmarks, the dependency catch2 must be available under catch2/catch.hpp.
Further it is necessary that gcc is used because we compare the library at hand with GNU's trie implementation.
The performance-benchmarks can be executed with `make benchmark`.
The memory-benchmarks can be executed with `make benchmark_memory`.
The results can be found in benchmark/ (I tested on an Intel Core i7 from 2012).
Here are my results for the performance benchmarks:![bm1](benchmark/bm1.png)
![bm2](benchmark/bm2.png)
This library is listed in four different configurations and compared to `std::map` and `__gnu_pbds::trie` ([A GNU trie implementation](https://gcc.gnu.org/onlinedocs/libstdc++/ext/pb_ds/trie_based_containers.html)).