tests: Add an automatic perf profiler (#38543)

Add an auto-profiler for our tests, to hopefully allow better triage of
performance impacts resulting from code changes. Comprehensive usage
docs are in the code.

Currently, it uses hyperfine under the hood and prints markdown to the
command line for all crates with relevant tests enabled. We may want to
expand this to allow outputting json in the future to allow e.g.
automatically comparing the difference between two runs on different
commits, and in general a lot of functionality could be added (maybe
measuring memory usage?).

It's enabled (mostly as an example) on two tests inside `gpui` and a
bunch of those inside `vim`. I'd have happily used `cargo bench`, but that's nightly-only.

Release Notes:

- N/A
This commit is contained in:
Nia
2025-09-20 09:04:32 +02:00
committed by GitHub
parent be77682a3f
commit 782058647d
12 changed files with 393 additions and 5 deletions
Generated
+9
View File
@@ -7924,6 +7924,7 @@ dependencies = [
"unicode-segmentation",
"usvg",
"util",
"util_macros",
"uuid",
"waker-fn",
"wayland-backend",
@@ -12163,6 +12164,13 @@ version = "2.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
[[package]]
name = "perf"
version = "0.1.0"
dependencies = [
"workspace-hack",
]
[[package]]
name = "pest"
version = "2.8.0"
@@ -18727,6 +18735,7 @@ dependencies = [
"tokio",
"ui",
"util",
"util_macros",
"vim_mode_setting",
"workspace",
"workspace-hack",