tests: initial benchmarking setup
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: If0ed2dd4279abf155a8ddc678ca047736a6a6964
This commit is contained in:
parent
121803b13c
commit
f385eebc99
4 changed files with 160 additions and 0 deletions
47
tests/benchmark/large.nix
Normal file
47
tests/benchmark/large.nix
Normal 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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue