Skip to content
This repository was archived by the owner on Feb 3, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,6 @@ Cargo.lock
!/Cargo.lock

stress-test/passthrough-dna.dna.json
FlameGraph
*.svg
perf.data*
5 changes: 5 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ with holonix.pkgs;
config = config;
}).buildInputs

++ (holonix.pkgs.callPackage ./profiling {
pkgs = holonix.pkgs;
config = config;
}).buildInputs

++ (holonix.pkgs.callPackage ./docker {
pkgs = holonix.pkgs;
}).buildInputs
Expand Down
21 changes: 21 additions & 0 deletions profiling/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{ pkgs,config }:
let
name = "hc-sim2h-server-perf";
script-sim2h-server-perf = pkgs.writeShellScriptBin name
''
cd crates/sim2h_server && cargo build -p sim2h_server --release && perf record --call-graph dwarf sim2h_server "$@"
'';

script-hc-conductor-perf = pkgs.writeShellScriptBin "hc-conductor-perf"
''
cd crates/holochain && cargo build -p holochain --release && perf record --call-graph dwarf holochain
'';

script-hc-generate-flame-graph = pkgs.writeShellScriptBin "hc-generate-flame-graph"
''
perf script | stackcollapse.pl | flamegraph.pl > generated-graph.svg
'';
in
{
buildInputs = [ script-sim2h-server-perf script-hc-generate-flame-graph script-hc-conductor-perf];
}