erllama_cache_bench (erllama v0.1.0)

View Source

Microbench helpers for the cache subsystem.

These do NOT measure realistic prefill / decode latency — that requires the real erllama_nif against llama.cpp (step 2b). What they do measure: framing / CRC / link-publish / disk-load latency. Useful as a regression guard on the I/O path and as a template for the post-2b benchmark that will assert the >=10x cold-vs-warm speedup target on NVMe.

Usage from the shell:

1> application:ensureall_started(erllama). 2> {ok, } = erllama_cache_disk_srv:start_link(b_disk, "/tmp/b"). 3> erllama_cache_bench:save_load(b_disk, 100, 4096).

Summary

Functions

save_load(DiskSrv, Runs, PayloadBytes)

-spec save_load(atom(), pos_integer(), pos_integer()) ->
                   #{save_us_avg := non_neg_integer(),
                     load_us_avg := non_neg_integer(),
                     runs := pos_integer(),
                     payload_bytes := pos_integer()}.