Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

build(recording): add dhat dependency, memory-profiling feature, and stress test example

Richie McIlroy640a3a0761aa
diff --git a/Cargo.lock b/Cargo.lock
index 31722e05b..5abb5f980 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1596,6 +1596,7 @@ dependencies = [
"core-graphics 0.24.0",
"cpal 0.15.3 (git+https://github.com/CapSoftware/cpal?rev=3cc779a7b4ca)",
"device_query",
+ "dhat",
"either",
"ffmpeg-next",
"flume",
@@ -2730,6 +2731,22 @@ dependencies = [
"x11",
]
+[[package]]
+name = "dhat"
+version = "0.3.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "98cd11d84628e233de0ce467de10b8633f4ddaecafadefc86e13b84b8739b827"
+dependencies = [
+ "backtrace",
+ "lazy_static",
+ "mintex",
+ "parking_lot",
+ "rustc-hash 1.1.0",
+ "serde",
+ "serde_json",
+ "thousands",
+]
+
[[package]]
name = "diff"
version = "0.1.13"
@@ -5529,6 +5546,12 @@ dependencies = [
"simd-adler32",
]
+[[package]]
+name = "mintex"
+version = "0.1.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c505b3e17ed6b70a7ed2e67fbb2c560ee327353556120d6e72f5232b6880d536"
+
[[package]]
name = "mio"
version = "0.8.11"
@@ -7223,7 +7246,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9120690fafc389a67ba3803df527d0ec9cbbc9cc45e4cc20b332996dfb672425"
dependencies = [
"anyhow",
- "itertools 0.13.0",
+ "itertools 0.14.0",
"proc-macro2",
"quote",
"syn 2.0.106",
@@ -10195,6 +10218,12 @@ dependencies = [
"syn 2.0.106",
]
+[[package]]
+name = "thousands"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3bf63baf9f5039dadc247375c29eb13706706cfde997d0330d05aa63a77d8820"
+
[[package]]
name = "thread_local"
version = "1.1.9"
diff --git a/crates/recording/Cargo.toml b/crates/recording/Cargo.toml
index 8d72a33ea..54d25cdaf 100644
--- a/crates/recording/Cargo.toml
+++ b/crates/recording/Cargo.toml
@@ -9,6 +9,7 @@ workspace = true
[features]
default = []
test-utils = []
+memory-profiling = ["dep:dhat"]
[dependencies]
cap-audio = { path = "../audio" }
@@ -57,6 +58,7 @@ inquire = "0.7.5"
replace_with = "0.1.8"
retry = "2.1.0"
sysinfo = "0.35"
+dhat = { version = "0.3", optional = true }
workspace-hack = { version = "0.1", path = "../workspace-hack" }
[target.'cfg(target_os = "macos")'.dependencies]
@@ -117,3 +119,6 @@ name = "playback-test-runner"
[[example]]
name = "real-device-test-runner"
+
+[[example]]
+name = "memory-stress-test"