Skip to content

tensorush/zig-mementohash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zig-mementohash

CI CD DC LC

🚀 Usage

  • Add mementohash dependency to build.zig.zon.
zig fetch --save https://github.com/tensorush/zig-mementohash/archive/<git_tag_or_commit_hash>.tar.gz
  • Use mementohash dependency in build.zig.
const mementohash_dep = b.dependency("mementohash", .{
    .target = target,
    .optimize = optimize,
});
const mementohash_mod = mementohash_dep.module("MementoHash");
<compile>.root_module.addImport("MementoHash", mementohash_mod);

📊 Benchmarks

  • Speed: the time the algorithm needs to find the node the given key belongs to.

    $ zig build bench -- -s
    Elapsed time: 151.215ms
  • Balance: the ability of the algorithm to spread the keys evenly across the cluster nodes.

    $ zig build bench -- -b
    Load balance: 7.84
  • Monotonicity: the ability of the algorithm to move the minimum amount of resources when the cluster scales.

    $ zig build bench -- -m
    Number of misplaced keys after removal: 0.00%
    Number of misplaced keys after restoring: 0.00%