All Projects → tokenrove → fixie-trie

tokenrove / fixie-trie

Licence: other
Compact tries for fixed-width keys

Programming Languages

rust
11053 projects
shell
77523 projects

Projects that are alternatives of or similar to fixie-trie

Data Structures
Data-Structures using C++.
Stars: ✭ 121 (+426.09%)
Mutual labels:  data-structure, trie
Leetcode
High-quality LeetCode solutions
Stars: ✭ 178 (+673.91%)
Mutual labels:  data-structure, trie
trie
Trie (a.k.a. prefix tree) C# implementation. Has constant-time string prefix lookup.
Stars: ✭ 84 (+265.22%)
Mutual labels:  data-structure, trie
harsh
Hashids implementation in Rust
Stars: ✭ 48 (+108.7%)
Mutual labels:  rust-library
rust-lp-modeler
Lp modeler written in Rust
Stars: ✭ 75 (+226.09%)
Mutual labels:  rust-library
radix
Golang radix tree implementation
Stars: ✭ 30 (+30.43%)
Mutual labels:  trie
bmemcached-rs
Rust binary memcached implementation
Stars: ✭ 24 (+4.35%)
Mutual labels:  rust-library
Swift-X-Algorithms
🔨 Algorithms & Data Structures implemented in Swift X. `let X = 5.0`
Stars: ✭ 22 (-4.35%)
Mutual labels:  data-structure
aho-corasick-node
A Node implementation of the Aho-Corasick string matching algorithm based on DoubleArray Trie.
Stars: ✭ 16 (-30.43%)
Mutual labels:  trie
serial test
Allows for the creation of serialised Rust tests
Stars: ✭ 105 (+356.52%)
Mutual labels:  rust-library
AlgoDaily
just for fun
Stars: ✭ 118 (+413.04%)
Mutual labels:  trie
vpsearch
C library for finding nearest (most similar) element in a set
Stars: ✭ 27 (+17.39%)
Mutual labels:  rust-library
trickster
user-friendly linux memory hacking library
Stars: ✭ 50 (+117.39%)
Mutual labels:  rust-library
rust-rgb
struct RGB for sharing pixels between crates
Stars: ✭ 70 (+204.35%)
Mutual labels:  rust-library
lucilla
Fast, efficient, in-memory Full Text Search for Kotlin
Stars: ✭ 102 (+343.48%)
Mutual labels:  trie
Data-Structures
Algorithmic Problems Solutions -- hash table code featured in geeksforgeeks
Stars: ✭ 44 (+91.3%)
Mutual labels:  trie
gmap
heterogenous Map over a GADT
Stars: ✭ 40 (+73.91%)
Mutual labels:  data-structure
lonlat bng
A multithreaded Rust library with FFI for converting WGS84 longitude and latitude coordinates into BNG (OSGB36) Eastings and Northings and vice versa (using OSTN15)
Stars: ✭ 20 (-13.04%)
Mutual labels:  rust-library
the-entitytainer
A single header library for managing game entity hierarchies.
Stars: ✭ 31 (+34.78%)
Mutual labels:  data-structure
hackerrank-30-Days-of-Code
Hackerrank Solutions of "30 Days of Code Challenges "
Stars: ✭ 23 (+0%)
Mutual labels:  data-structure

By their very nature, maps were always works in progress, and Gentle – his resolve strengthened by thinking of them that way – decided after many months of delay to turn his hand to making one.

— Imajica

An implementation of "fixie tries", inspired by Tony Finch's qp-tries but for fixed-length keys, storing the key implicitly in the trie where possible. Even though qp-tries were the inspiration, the approach is actually closer to array mapped tries (AMT/HAMT).

You can (and should) run the benchmarks with benchmark.sh. This should tell you at least a little about how fixie tries fare, both in speed and memory consumption, on your system, at least for the cases of random insertions of certain sizes.

There are countless trie variants, so although I'm giving this one a new name, it probably already exists in some form.

This is x86_64-specific, because we stuff the branch bitmap in the upper 16 bits of a pointer; pointers on this platform are actually 48-bit, so no harm done, but this doesn't necessarily hold on other platforms. And there wouldn't be enough room for the bitmap if pointers were 32-bit.

(The mask for pointers is 0x0000_ffff_ffff_fffe.)

Part of my interest in doing this was to see if it was possible to write this kind of stuff in Rust, and it seems to be possible and mostly pleasant.

This implementation is mostly an experiment; in particular, the current approach is unfriendly to the allocator, making a lot of tiny allocations. Slab allocation or similar would probably make sense.

It might be nice to do something like direct pointing from poptries on top, where the first n bits are covered by a 2ⁿ array of tries.

I discuss this structure in more detail in an article on my blog.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].