tests: initial benchmarking setup

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: If0ed2dd4279abf155a8ddc678ca047736a6a6964
This commit is contained in:
raf 2026-02-22 23:01:52 +03:00
commit f385eebc99
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
4 changed files with 160 additions and 0 deletions

47
tests/benchmark/large.nix Normal file
View file

@ -0,0 +1,47 @@
# Large :b:oke ---I mean...benchmark, for stress testing
let
# Generate large list
range = start: end:
if start >= end
then []
else [start] ++ range (start + 1) end;
# Deep nesting
deepNest = {a = {b = {c = {d = {e = {f = 42;};};};};};};
# Large attrset
largeAttrs = {
a1 = 1;
a2 = 2;
a3 = 3;
a4 = 4;
a5 = 5;
a6 = 6;
a7 = 7;
a8 = 8;
a9 = 9;
a10 = 10;
b1 = 11;
b2 = 12;
b3 = 13;
b4 = 14;
b5 = 15;
b6 = 16;
b7 = 17;
b8 = 18;
b9 = 19;
b10 = 20;
};
# Recursive attrset
recursive = rec {
x = 10;
y = x * 2;
z = y + x;
result = z * 3;
};
in {
list_100 = range 1 100;
deep = deepNest.a.b.c.d.e.f;
inherit largeAttrs recursive;
}