Skip to content

Commit 598e913

Browse files
committed
feat: add benchmark script
This commit introduces a new benchmark script that uses hyperfine to measure the performance of the Go and Rust programs. The script is added to the flake.nix file and can be executed using `nix run .#benchmark`. --- {"auto-commit-msg":{"language":"rust","version":"0.4.0-dev","model":"gemini-2.5-flash-lite","response_time":1.29,"execution_time":1.32}}
1 parent 65e5430 commit 598e913

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

flake.nix

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,18 @@
3232
nix-filter.overlays.default
3333
];
3434
};
35+
lib = pkgs.lib;
3536
in
36-
{
37-
default = self.packages.${system}.go;
37+
rec {
38+
benchmark = pkgs.writeShellScriptBin "benchmark" ''
39+
${lib.getExe pkgs.hyperfine} \
40+
--runs 5 \
41+
--prepare 'sleep 1' \
42+
--export-markdown benchmark.md \
43+
${lib.getExe go} \
44+
${lib.getExe rust}
45+
'';
46+
default = go;
3847
go = pkgs.callPackage ./default.nix { };
3948
rust = pkgs.callPackage ./rust/default.nix { };
4049
}

0 commit comments

Comments
 (0)