Skip to content

tensorush/zig-sieve

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zig-sieve

Zig implementation of SIEVE cache eviction algorithm.

Usage

  1. Add sieve dependency to build.zig.zon:
zig fetch --save git+https://github.com/tensorush/zig-sieve.git
  1. Use sieve dependency in build.zig:
const sieve_dep = b.dependency("sieve", .{
    .target = target,
    .optimize = optimize,
});
const sieve_mod = sieve_dep.module("sieve");

...
    .imports = &.{
        .{ .name = "sieve", .module = sieve_mod },
    },
...

Benchmarks (MacBook M1 Pro)

  • Sequence - the time to cache and retrieve integer values:
$ zig build bench -- s
Sequence: 22.958us
  • Composite - the time to cache and retrieve composite values:
$ zig build bench -- c
Composite: 37.668us
  • Composite (normal) - the time to cache and retrieve normally-distributed composite values:
$ zig build bench -- n
Composite Normal: 108.001us

About

Zig implementation of SIEVE cache eviction algorithm.

Topics

Resources

License

Stars

Watchers

Forks

Languages