From 4bac7c5654245c8d622c54ac2539bac103b49b4b Mon Sep 17 00:00:00 2001 From: Maksim Ryndin Date: Fri, 7 Nov 2025 14:27:43 +0000 Subject: [PATCH 1/2] samply kit Co-authored-by: Xander van der Goot xrvdg@users.noreply.github.com --- CONTRIBUTING.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e2998e2..6aa2307 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -84,7 +84,11 @@ Then, we can run: ```sh samply record 'TODO(template) update with your binary e.g. ./target/release/...' ``` -This command will open a browser page that contains a graphic representation of where the time is being spent in our application. +This command will open a browser page that contains a graphic representation of where the time is being spent in our application. + +[Samply Kit](https://github.com/xrvdg/samply-kit) is a small toolkit for analysing and manipulating Samply and Firefox Profile data. It provides utilities for filtering and aggregating sample counts per function: +- Filtering is very helpful when working with Rayon for example. Rayon clobbers up stack traces and by filtering the nested rayon calls you can have a clean stack trace again. +- Aggregating sample counts per function helps in finding functions that look like small contributors in a regular flamegraphs, but in aggregate are actually large contributors. This is useful for finding mathematical routines such as multiplications and hashes that need to be optimised, or excessive memory operations that don't show up otherwise. ### Dhat We can add Dhat as a dependency: From a299cd3b0d96bb1a8a47984e287379dea668f57d Mon Sep 17 00:00:00 2001 From: Maksim Ryndin Date: Mon, 10 Nov 2025 18:28:49 +0000 Subject: [PATCH 2/2] fixup! samply kit --- CONTRIBUTING.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6aa2307..0abe0e6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -117,5 +117,4 @@ Many other profiling libraries exist, please check the [Rust Performance Book](h But these 3 should be enough for the average application to identify bottlenecks and optimize them. For async-rust we also recommend: [Tracing](https://crates.io/crates/tracing), [Tokio-Console](https://crates.io/crates/tokio-console), and [Oha](https://crates.io/crates/oha). -For Rayon-based parallel Rust code, we recommend Samply. -It provides good profiling despite missing some multithreading details. \ No newline at end of file +For Rayon-based parallel Rust code, we recommend Samply in combination with [Samply Kit](https://github.com/xrvdg/samply-kit) to filter out Rayon from the stack traces. \ No newline at end of file