add benchmarks for option times
This commit is contained in:
parent
3ce367d2ad
commit
de3cde5185
10 changed files with 519 additions and 0 deletions
40
bench-option-times.nix
Normal file
40
bench-option-times.nix
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
{
|
||||
nixpkgs ? fetchTarball "https://github.com/NixOS/nixpkgs/archive/release-25.05.tar.gz",
|
||||
pkgs ? import nixpkgs { },
|
||||
}:
|
||||
let
|
||||
inherit (pkgs) nixosTests;
|
||||
|
||||
jenkins = nixosTests.jenkins.nodes.master;
|
||||
grafana = nixosTests.grafana.provision.nodes.provisionNix;
|
||||
gotosocial = nixosTests.gotosocial.nodes.machine;
|
||||
openssh = nixosTests.openssh.nodes.server-match-rule;
|
||||
in
|
||||
builtins.seq pkgs.path
|
||||
{
|
||||
jenkins = {
|
||||
toplevel = jenkins.system.build.toplevel.outPath;
|
||||
unit-text = jenkins.systemd.units."jenkins.service".text;
|
||||
settings = jenkins.services.jenkins.jobBuilder;
|
||||
};
|
||||
|
||||
grafana = {
|
||||
toplevel = grafana.system.build.toplevel.outPath;
|
||||
unit-text = grafana.systemd.units."grafana.service".text;
|
||||
settings = grafana.services.grafana.settings;
|
||||
};
|
||||
|
||||
gotosocial = {
|
||||
toplevel = gotosocial.system.build.toplevel.outPath;
|
||||
unit-text = gotosocial.systemd.units."gotosocial.service".text;
|
||||
settings = gotosocial.services.gotosocial.settings;
|
||||
};
|
||||
|
||||
openssh = {
|
||||
openssh-toplevel = openssh.system.build.toplevel.outPath;
|
||||
config-text = openssh.environment.etc."ssh/sshd_config".source.buildCommand;
|
||||
settings = {
|
||||
inherit (openssh.services.openssh) settings extraConfig;
|
||||
};
|
||||
};
|
||||
}
|
||||
35
bench-option-times.xsh
Executable file
35
bench-option-times.xsh
Executable file
|
|
@ -0,0 +1,35 @@
|
|||
#!/usr/bin/env xonsh
|
||||
# vim: ft=xonsh tabstop=4 shiftwidth=0 expandtab
|
||||
|
||||
$RAISE_SUBPROC_ERROR = True
|
||||
|
||||
import json
|
||||
import sys
|
||||
|
||||
NIX_FILE = "./bench-option-times.nix"
|
||||
|
||||
def nix_inst(group: str, attr: str) -> str:
|
||||
return f"nix-instantiate --quiet --eval --no-eval-cache --json --strict {NIX_FILE} -A {group}.{attr}"
|
||||
|
||||
def hyperfine_for(group: str, attrs: list) -> list:
|
||||
cmd = [
|
||||
"hyperfine",
|
||||
"--style=full",
|
||||
"--shell=none",
|
||||
f"--export-json=benches/option-times-{group}.json",
|
||||
f"--export-markdown=benches/option-times-{group}.md",
|
||||
"--time-unit=millisecond",
|
||||
]
|
||||
|
||||
for attr in attrs:
|
||||
cmd.extend(["-n", f"{group}-{attr}"])
|
||||
cmd.append(nix_inst(group, attr))
|
||||
|
||||
return cmd
|
||||
|
||||
# Get all the benchmarks.
|
||||
bench_names = $(nix-instantiate --eval --strict --json -E f"builtins.mapAttrs (_: value: builtins.attrNames value) (import {NIX_FILE} {{ }})")
|
||||
|
||||
for group, benches in json.loads(bench_names).items():
|
||||
cmd = hyperfine_for(group, benches)
|
||||
@(cmd)
|
||||
106
benches/option-times-gotosocial.json
Normal file
106
benches/option-times-gotosocial.json
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
{
|
||||
"results": [
|
||||
{
|
||||
"command": "gotosocial-settings",
|
||||
"mean": 0.44739719890000007,
|
||||
"stddev": 0.007291171143220014,
|
||||
"median": 0.4448054685,
|
||||
"user": 0.33229479999999995,
|
||||
"system": 0.09489829999999999,
|
||||
"min": 0.439405274,
|
||||
"max": 0.45998648700000005,
|
||||
"times": [
|
||||
0.44395817200000004,
|
||||
0.450772565,
|
||||
0.4424062,
|
||||
0.445652765,
|
||||
0.44129323800000003,
|
||||
0.45998648700000005,
|
||||
0.44267099800000004,
|
||||
0.45940887100000005,
|
||||
0.44841741900000004,
|
||||
0.439405274
|
||||
],
|
||||
"exit_codes": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"command": "gotosocial-toplevel",
|
||||
"mean": 1.6840333114000003,
|
||||
"stddev": 0.017009469926263284,
|
||||
"median": 1.679443417,
|
||||
"user": 1.8378691,
|
||||
"system": 0.2485731,
|
||||
"min": 1.663588104,
|
||||
"max": 1.714939721,
|
||||
"times": [
|
||||
1.682202138,
|
||||
1.671827199,
|
||||
1.663588104,
|
||||
1.711149722,
|
||||
1.6766846960000001,
|
||||
1.6835730130000002,
|
||||
1.689862777,
|
||||
1.714939721,
|
||||
1.676600364,
|
||||
1.6699053799999999
|
||||
],
|
||||
"exit_codes": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"command": "gotosocial-unit-text",
|
||||
"mean": 1.1818055858,
|
||||
"stddev": 0.014725922988799914,
|
||||
"median": 1.1762601735,
|
||||
"user": 0.9307882000000001,
|
||||
"system": 0.225387,
|
||||
"min": 1.171901719,
|
||||
"max": 1.211838794,
|
||||
"times": [
|
||||
1.175013092,
|
||||
1.171999902,
|
||||
1.17719549,
|
||||
1.178809828,
|
||||
1.175331681,
|
||||
1.177188666,
|
||||
1.1720555080000001,
|
||||
1.206721178,
|
||||
1.211838794,
|
||||
1.171901719
|
||||
],
|
||||
"exit_codes": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
5
benches/option-times-gotosocial.md
Normal file
5
benches/option-times-gotosocial.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|
||||
|:---|---:|---:|---:|---:|
|
||||
| `gotosocial-settings` | 447.4 ± 7.3 | 439.4 | 460.0 | 1.00 |
|
||||
| `gotosocial-toplevel` | 1684.0 ± 17.0 | 1663.6 | 1714.9 | 3.76 ± 0.07 |
|
||||
| `gotosocial-unit-text` | 1181.8 ± 14.7 | 1171.9 | 1211.8 | 2.64 ± 0.05 |
|
||||
106
benches/option-times-grafana.json
Normal file
106
benches/option-times-grafana.json
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
{
|
||||
"results": [
|
||||
{
|
||||
"command": "grafana-settings",
|
||||
"mean": 1.2109605485000001,
|
||||
"stddev": 0.011766385047312722,
|
||||
"median": 1.2074279495,
|
||||
"user": 0.9673155,
|
||||
"system": 0.2167788,
|
||||
"min": 1.200629047,
|
||||
"max": 1.238885118,
|
||||
"times": [
|
||||
1.238885118,
|
||||
1.2025158710000001,
|
||||
1.203153348,
|
||||
1.200629047,
|
||||
1.212398038,
|
||||
1.209097609,
|
||||
1.21907983,
|
||||
1.20575829,
|
||||
1.201253926,
|
||||
1.216834408
|
||||
],
|
||||
"exit_codes": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"command": "grafana-toplevel",
|
||||
"mean": 1.9997878254000003,
|
||||
"stddev": 0.010817756340646838,
|
||||
"median": 2.0007223915,
|
||||
"user": 2.4902427000000005,
|
||||
"system": 0.2955239,
|
||||
"min": 1.986144187,
|
||||
"max": 2.0216858,
|
||||
"times": [
|
||||
1.9878496120000002,
|
||||
2.001929156,
|
||||
2.00218159,
|
||||
2.0216858,
|
||||
1.986144187,
|
||||
2.007285928,
|
||||
1.9899284270000002,
|
||||
2.006988343,
|
||||
1.999515627,
|
||||
1.9943695840000002
|
||||
],
|
||||
"exit_codes": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"command": "grafana-unit-text",
|
||||
"mean": 1.3141523978,
|
||||
"stddev": 0.016353282538099957,
|
||||
"median": 1.308871596,
|
||||
"user": 1.2082936999999998,
|
||||
"system": 0.24129499999999998,
|
||||
"min": 1.296790683,
|
||||
"max": 1.34655936,
|
||||
"times": [
|
||||
1.299149725,
|
||||
1.309508099,
|
||||
1.34655936,
|
||||
1.308235093,
|
||||
1.296790683,
|
||||
1.338672823,
|
||||
1.30402189,
|
||||
1.3138490630000002,
|
||||
1.306745902,
|
||||
1.31799134
|
||||
],
|
||||
"exit_codes": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
5
benches/option-times-grafana.md
Normal file
5
benches/option-times-grafana.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|
||||
|:---|---:|---:|---:|---:|
|
||||
| `grafana-settings` | 1211.0 ± 11.8 | 1200.6 | 1238.9 | 1.00 |
|
||||
| `grafana-toplevel` | 1999.8 ± 10.8 | 1986.1 | 2021.7 | 1.65 ± 0.02 |
|
||||
| `grafana-unit-text` | 1314.2 ± 16.4 | 1296.8 | 1346.6 | 1.09 ± 0.02 |
|
||||
106
benches/option-times-jenkins.json
Normal file
106
benches/option-times-jenkins.json
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
{
|
||||
"results": [
|
||||
{
|
||||
"command": "jenkins-settings",
|
||||
"mean": 0.4009850514,
|
||||
"stddev": 0.005929423552281215,
|
||||
"median": 0.3995273655,
|
||||
"user": 0.2771106,
|
||||
"system": 0.10243419999999999,
|
||||
"min": 0.39304956700000004,
|
||||
"max": 0.41265536,
|
||||
"times": [
|
||||
0.395795954,
|
||||
0.398216485,
|
||||
0.399215294,
|
||||
0.39969774500000005,
|
||||
0.400215423,
|
||||
0.40209539200000005,
|
||||
0.40955230800000003,
|
||||
0.41265536,
|
||||
0.399356986,
|
||||
0.39304956700000004
|
||||
],
|
||||
"exit_codes": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"command": "jenkins-toplevel",
|
||||
"mean": 3.2568060105,
|
||||
"stddev": 0.013393076680562286,
|
||||
"median": 3.2576567484999996,
|
||||
"user": 4.657644599999999,
|
||||
"system": 0.42038089999999995,
|
||||
"min": 3.227748115,
|
||||
"max": 3.276940996,
|
||||
"times": [
|
||||
3.248534186,
|
||||
3.262138748,
|
||||
3.276940996,
|
||||
3.227748115,
|
||||
3.267212543,
|
||||
3.25562645,
|
||||
3.251105351,
|
||||
3.259687047,
|
||||
3.252379012,
|
||||
3.266687657
|
||||
],
|
||||
"exit_codes": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"command": "jenkins-unit-text",
|
||||
"mean": 0.7732673119,
|
||||
"stddev": 0.005499580095081173,
|
||||
"median": 0.771536595,
|
||||
"user": 0.5957463000000001,
|
||||
"system": 0.1538046,
|
||||
"min": 0.766117475,
|
||||
"max": 0.7828958880000001,
|
||||
"times": [
|
||||
0.7828958880000001,
|
||||
0.7675125060000001,
|
||||
0.7789448240000001,
|
||||
0.771671565,
|
||||
0.774774521,
|
||||
0.779079512,
|
||||
0.7714016250000001,
|
||||
0.769314154,
|
||||
0.766117475,
|
||||
0.7709610490000001
|
||||
],
|
||||
"exit_codes": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
5
benches/option-times-jenkins.md
Normal file
5
benches/option-times-jenkins.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|
||||
|:---|---:|---:|---:|---:|
|
||||
| `jenkins-settings` | 401.0 ± 5.9 | 393.0 | 412.7 | 1.00 |
|
||||
| `jenkins-toplevel` | 3256.8 ± 13.4 | 3227.7 | 3276.9 | 8.12 ± 0.12 |
|
||||
| `jenkins-unit-text` | 773.3 ± 5.5 | 766.1 | 782.9 | 1.93 ± 0.03 |
|
||||
106
benches/option-times-openssh.json
Normal file
106
benches/option-times-openssh.json
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
{
|
||||
"results": [
|
||||
{
|
||||
"command": "openssh-config-text",
|
||||
"mean": 0.6270332452,
|
||||
"stddev": 0.005153351179214221,
|
||||
"median": 0.6267400235,
|
||||
"user": 0.4672764,
|
||||
"system": 0.13824029999999998,
|
||||
"min": 0.618906831,
|
||||
"max": 0.6381079430000001,
|
||||
"times": [
|
||||
0.62634866,
|
||||
0.6285607440000001,
|
||||
0.623967014,
|
||||
0.625198739,
|
||||
0.6301242290000001,
|
||||
0.6381079430000001,
|
||||
0.618906831,
|
||||
0.629386863,
|
||||
0.6226000420000001,
|
||||
0.627131387
|
||||
],
|
||||
"exit_codes": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"command": "openssh-openssh-toplevel",
|
||||
"mean": 2.5892949095000004,
|
||||
"stddev": 0.015748501098646058,
|
||||
"median": 2.5891136235000003,
|
||||
"user": 3.6708615,
|
||||
"system": 0.4357985999999999,
|
||||
"min": 2.56350331,
|
||||
"max": 2.614979868,
|
||||
"times": [
|
||||
2.586165248,
|
||||
2.56350331,
|
||||
2.588670983,
|
||||
2.589556264,
|
||||
2.5714068240000003,
|
||||
2.611807761,
|
||||
2.593133909,
|
||||
2.5915303290000002,
|
||||
2.582194599,
|
||||
2.614979868
|
||||
],
|
||||
"exit_codes": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"command": "openssh-settings",
|
||||
"mean": 0.6220687502000001,
|
||||
"stddev": 0.00829306273782679,
|
||||
"median": 0.619168269,
|
||||
"user": 0.4623053,
|
||||
"system": 0.13772829999999997,
|
||||
"min": 0.613905696,
|
||||
"max": 0.642063175,
|
||||
"times": [
|
||||
0.6229173050000001,
|
||||
0.618984148,
|
||||
0.6172019360000001,
|
||||
0.618679053,
|
||||
0.6196362590000001,
|
||||
0.6173936120000001,
|
||||
0.642063175,
|
||||
0.630553928,
|
||||
0.613905696,
|
||||
0.6193523900000001
|
||||
],
|
||||
"exit_codes": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
5
benches/option-times-openssh.md
Normal file
5
benches/option-times-openssh.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|
||||
|:---|---:|---:|---:|---:|
|
||||
| `openssh-config-text` | 627.0 ± 5.2 | 618.9 | 638.1 | 1.01 ± 0.02 |
|
||||
| `openssh-openssh-toplevel` | 2589.3 ± 15.7 | 2563.5 | 2615.0 | 4.16 ± 0.06 |
|
||||
| `openssh-settings` | 622.1 ± 8.3 | 613.9 | 642.1 | 1.00 |
|
||||
Loadingâ¦
Add table
Add a link
Reference in a new issue