Skip to content

Latest commit

 

History

History
62 lines (46 loc) · 2.19 KB

README.md

File metadata and controls

62 lines (46 loc) · 2.19 KB

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%