tensorush / zig-sieve

πŸ’° Zig port of the SIEVE cache eviction algorithm created by @yazhuo and @1a1a11a.

Home Page:https://tensorush.github.io/zig-sieve/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🦎 πŸ’° zig sieve

CI CD DC CC LC

Zig implementation of the SIEVE cache eviction algorithm created by Yazhuo Zhang and Juncheng Yang.

πŸš€ Usage

  1. Add sieve as a dependency in your build.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> to 12200000000000000000000000000000000000000000000000000000000000000000, and Zig will provide the correct found value in an error message.

  2. Add sieve as a module in your build.zig.

    build.zig example
    const sieve = b.dependency("sieve", .{});
    exe.addModule("sieve", sieve.module("sieve"));

πŸ“Š Benchmarks

$ zig build bench
Sequence: 27.666us
Composite: 38.5us
Composite Normal: 141.458us

About

πŸ’° Zig port of the SIEVE cache eviction algorithm created by @yazhuo and @1a1a11a.

https://tensorush.github.io/zig-sieve/

License:MIT License


Languages

Language:Zig 100.0%