Zig implementation of the SIEVE cache eviction algorithm created by Yazhuo Zhang and Juncheng Yang.
-
Add
sieve
as a dependency in yourbuild.zig.zon
.build.zig.zon
example.{ .name = "<name_of_your_package>", .version = "<version_of_your_package>", .dependencies = .{ .sieve = .{ .url = "https://github.com/tensorush/zig-sieve/archive/<git_tag_or_commit_hash>.tar.gz", .hash = "<package_hash>", }, }, }
Set
<package_hash>
to12200000000000000000000000000000000000000000000000000000000000000000
, and Zig will provide the correct found value in an error message. -
Add
sieve
as a module in yourbuild.zig
.build.zig
exampleconst sieve = b.dependency("sieve", .{}); exe.addModule("sieve", sieve.module("sieve"));
$ zig build bench
Sequence: 27.666us
Composite: 38.5us
Composite Normal: 141.458us