Skip to content

Benchmarks - #7

Merged
kbidzhiev merged 12 commits into
mainfrom
benchmarks
Jun 25, 2026
Merged

kbidzhiev merged 12 commits into
mainfrom
benchmarks

Conversation

@kbidzhiev

@kbidzhiev kbidzhiev commented Jun 25, 2026

Copy link
Copy Markdown
Owner

In this PR i've benchmark
LRU, LFU and Belady's optimal algo.

The file benchmark.cpp generates uniform random numbers [0:100) for input length 100'000.
benchmark/gnuplot script.gp produces a plot comparing these 3 strategies depending on cache size [10, 20, ... 100]

For a cache size 100 any integer random number from 0 to 99 hits a cache, therefore all 3 strategies crosspoint and give cache hit == 99900 (== length - cache_size)

@kbidzhiev
kbidzhiev merged commit 720890c into main Jun 25, 2026
3 checks passed
@kbidzhiev
kbidzhiev deleted the benchmarks branch June 25, 2026 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant