Skip to content

Commit

Permalink
database: add fuzz/perf crate
Browse files Browse the repository at this point in the history
  • Loading branch information
yukibtc committed Dec 5, 2023
1 parent b8611da commit 09310b6
Show file tree
Hide file tree
Showing 7 changed files with 1,517 additions and 0 deletions.
69 changes: 69 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ members = [
"bindings/nostr-sdk-js",
"bindings/uniffi-bindgen",
"crates/*",
"crates/nostr-database/fuzz/perf"
]
default-members = ["crates/*"]
resolver = "2"
Expand Down
1 change: 1 addition & 0 deletions crates/nostr-database/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ license.workspace = true
readme = "README.md"
rust-version = "1.64.0"
keywords = ["nostr", "database"]
exclude = ["fuzz"]

[features]
default = []
Expand Down
10 changes: 10 additions & 0 deletions crates/nostr-database/fuzz/perf/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[package]
name = "nostr-database-perf"
version = "0.1.0"
edition = "2021"

[dependencies]
nostr-database = { path = "../../" }
serde_json = "1.0"
tokio = { workspace = true, features = ["full"] }
tracing-subscriber = { workspace = true, features = ["env-filter"] }
2 changes: 2 additions & 0 deletions crates/nostr-database/fuzz/perf/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
graph:
RUST_LOG=info CARGO_PROFILE_RELEASE_DEBUG=true cargo flamegraph --release -p nostr-database-perf -o flamegraph.svg
Loading

0 comments on commit 09310b6

Please sign in to comment.