Skip to content

Commit

Permalink
Added #[tracing::instrument(skip_all)] to add_subscriber
Browse files Browse the repository at this point in the history
  • Loading branch information
cloutiertyler committed Feb 28, 2024
1 parent d24ead5 commit 6e088a7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions crates/core/src/subscription/module_subscription_actor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ impl ModuleSubscriptions {
}

/// Add a subscriber to the module. NOTE: this function is blocking.
#[tracing::instrument(skip_all)]
pub fn add_subscriber(&self, sender: ClientConnectionSender, subscription: Subscribe) -> Result<(), DBError> {
let tx = &mut *scopeguard::guard(self.relational_db.begin_tx(), |tx| {
let ctx = ExecutionContext::subscribe(self.relational_db.address());
Expand Down

2 comments on commit 6e088a7

@github-actions
Copy link

@github-actions github-actions bot commented on 6e088a7 Feb 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark results

Benchmark Report

Legend:

  • load: number of rows pre-loaded into the database
  • count: number of rows touched by the transaction
  • index types:
    • unique: a single index on the id column
    • non_unique: no indexes
    • multi_index: non-unique index on every column
  • schemas:
    • person(id: u32, name: String, age: u64)
    • location(id: u32, x: u64, y: u64)

All throughputs are single-threaded.

Empty transaction

db on disk new latency old latency new throughput old throughput
sqlite 💿 422.4±1.52ns 412.9±2.36ns - -
sqlite 🧠 411.9±1.22ns 402.9±1.76ns - -
stdb_raw 💿 770.4±1.50ns 775.1±1.58ns - -
stdb_raw 🧠 719.7±1.51ns 724.4±1.59ns - -

Single-row insertions

db on disk schema index type load new latency old latency new throughput old throughput

Multi-row insertions

db on disk schema index type load count new latency old latency new throughput old throughput
sqlite 💿 u32_u64_str btree_each_column 2048 256 521.0±0.56µs 516.8±0.83µs 1919 tx/sec 1934 tx/sec
sqlite 💿 u32_u64_str unique_0 2048 256 137.5±0.70µs 141.2±0.42µs 7.1 Ktx/sec 6.9 Ktx/sec
sqlite 💿 u32_u64_u64 btree_each_column 2048 256 422.5±0.58µs 422.4±1.20µs 2.3 Ktx/sec 2.3 Ktx/sec
sqlite 💿 u32_u64_u64 unique_0 2048 256 126.2±0.31µs 130.8±6.70µs 7.7 Ktx/sec 7.5 Ktx/sec
sqlite 🧠 u32_u64_str btree_each_column 2048 256 451.4±0.49µs 449.1±0.78µs 2.2 Ktx/sec 2.2 Ktx/sec
sqlite 🧠 u32_u64_str unique_0 2048 256 120.1±0.31µs 120.7±0.26µs 8.1 Ktx/sec 8.1 Ktx/sec
sqlite 🧠 u32_u64_u64 btree_each_column 2048 256 368.6±0.50µs 368.5±0.28µs 2.6 Ktx/sec 2.7 Ktx/sec
sqlite 🧠 u32_u64_u64 unique_0 2048 256 106.8±0.49µs 109.9±0.90µs 9.1 Ktx/sec 8.9 Ktx/sec
stdb_raw 💿 u32_u64_str btree_each_column 2048 256 743.4±0.77µs 741.9±0.92µs 1345 tx/sec 1347 tx/sec
stdb_raw 💿 u32_u64_str unique_0 2048 256 641.2±1.18µs 644.2±1.16µs 1559 tx/sec 1552 tx/sec
stdb_raw 💿 u32_u64_u64 btree_each_column 2048 256 454.1±0.51µs 450.5±0.45µs 2.2 Ktx/sec 2.2 Ktx/sec
stdb_raw 💿 u32_u64_u64 unique_0 2048 256 404.3±0.27µs 405.7±0.94µs 2.4 Ktx/sec 2.4 Ktx/sec
stdb_raw 🧠 u32_u64_str btree_each_column 2048 256 517.3±0.25µs 513.6±0.19µs 1933 tx/sec 1946 tx/sec
stdb_raw 🧠 u32_u64_str unique_0 2048 256 421.9±0.59µs 426.0±1.24µs 2.3 Ktx/sec 2.3 Ktx/sec
stdb_raw 🧠 u32_u64_u64 btree_each_column 2048 256 347.7±0.57µs 345.4±0.22µs 2.8 Ktx/sec 2.8 Ktx/sec
stdb_raw 🧠 u32_u64_u64 unique_0 2048 256 305.4±0.17µs 306.3±0.90µs 3.2 Ktx/sec 3.2 Ktx/sec

Full table iterate

db on disk schema index type new latency old latency new throughput old throughput
sqlite 💿 u32_u64_str unique_0 20.5±0.12µs 21.2±0.37µs 47.6 Ktx/sec 46.0 Ktx/sec
sqlite 💿 u32_u64_u64 unique_0 19.3±0.28µs 20.1±0.12µs 50.6 Ktx/sec 48.6 Ktx/sec
sqlite 🧠 u32_u64_str unique_0 19.2±0.12µs 20.0±0.22µs 50.8 Ktx/sec 48.8 Ktx/sec
sqlite 🧠 u32_u64_u64 unique_0 17.8±0.13µs 18.7±0.07µs 54.8 Ktx/sec 52.3 Ktx/sec
stdb_raw 💿 u32_u64_str unique_0 17.8±0.00µs 18.8±0.05µs 54.9 Ktx/sec 52.0 Ktx/sec
stdb_raw 💿 u32_u64_u64 unique_0 15.0±0.00µs 16.0±0.00µs 65.3 Ktx/sec 61.2 Ktx/sec
stdb_raw 🧠 u32_u64_str unique_0 17.7±0.00µs 18.7±0.00µs 55.1 Ktx/sec 52.1 Ktx/sec
stdb_raw 🧠 u32_u64_u64 unique_0 14.9±0.00µs 15.9±0.00µs 65.6 Ktx/sec 61.4 Ktx/sec

Find unique key

db on disk key type load new latency old latency new throughput old throughput

Filter

db on disk key type index strategy load count new latency old latency new throughput old throughput
sqlite 💿 string index 2048 256 65.6±0.27µs 67.4±0.22µs 14.9 Ktx/sec 14.5 Ktx/sec
sqlite 💿 u64 index 2048 256 61.8±0.16µs 63.7±0.22µs 15.8 Ktx/sec 15.3 Ktx/sec
sqlite 🧠 string index 2048 256 63.5±0.29µs 65.4±0.41µs 15.4 Ktx/sec 14.9 Ktx/sec
sqlite 🧠 u64 index 2048 256 58.3±0.22µs 59.0±0.21µs 16.8 Ktx/sec 16.6 Ktx/sec
stdb_raw 💿 string index 2048 256 5.7±0.00µs 5.8±0.00µs 172.4 Ktx/sec 168.8 Ktx/sec
stdb_raw 💿 u64 index 2048 256 5.6±0.00µs 5.7±0.00µs 175.1 Ktx/sec 171.0 Ktx/sec
stdb_raw 🧠 string index 2048 256 5.6±0.00µs 5.7±0.01µs 174.7 Ktx/sec 170.4 Ktx/sec
stdb_raw 🧠 u64 index 2048 256 5.5±0.00µs 5.7±0.00µs 176.9 Ktx/sec 172.8 Ktx/sec

Serialize

schema format count new latency old latency new throughput old throughput
u32_u64_str bsatn 100 3.0±0.00µs 2.4±0.00µs 31.8 Mtx/sec 39.8 Mtx/sec
u32_u64_str json 100 5.2±0.05µs 5.0±0.07µs 18.4 Mtx/sec 19.0 Mtx/sec
u32_u64_str product_value 100 673.8±0.65ns 648.0±0.27ns 141.5 Mtx/sec 147.2 Mtx/sec
u32_u64_u64 bsatn 100 1705.0±46.41ns 1712.6±63.76ns 55.9 Mtx/sec 55.7 Mtx/sec
u32_u64_u64 json 100 3.2±0.16µs 3.4±0.03µs 29.5 Mtx/sec 28.1 Mtx/sec
u32_u64_u64 product_value 100 562.0±1.13ns 601.3±0.51ns 169.7 Mtx/sec 158.6 Mtx/sec

Module: invoke with large arguments

arg size new latency old latency new throughput old throughput
64KiB 60.1±5.49µs 60.6±3.71µs - -

Module: print bulk

line count new latency old latency new throughput old throughput
1 26.6±2.61µs 28.4±2.96µs - -
100 194.0±2.88µs 199.8±0.66µs - -
1000 1782.6±14.58µs 1882.0±329.56µs - -

Remaining benchmarks

name new latency old latency new throughput old throughput
sqlite/💿/update_bulk/u32_u64_str/unique_0/load=2048/count=256 46.0±0.29µs 47.5±0.25µs 21.2 Ktx/sec 20.5 Ktx/sec
sqlite/💿/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 40.7±0.18µs 41.8±0.12µs 24.0 Ktx/sec 23.4 Ktx/sec
sqlite/🧠/update_bulk/u32_u64_str/unique_0/load=2048/count=256 39.9±0.29µs 40.1±0.16µs 24.5 Ktx/sec 24.4 Ktx/sec
sqlite/🧠/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 34.6±0.09µs 36.3±0.12µs 28.2 Ktx/sec 26.9 Ktx/sec
stdb_module/💿/update_bulk/u32_u64_str/unique_0/load=2048/count=256 2.1±0.27ms 1940.5±1.47µs 473 tx/sec 515 tx/sec
stdb_module/💿/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 1431.3±2.25µs 1425.0±1.19µs 698 tx/sec 701 tx/sec
stdb_raw/💿/update_bulk/u32_u64_str/unique_0/load=2048/count=256 1158.9±2.12µs 1159.5±1.24µs 862 tx/sec 862 tx/sec
stdb_raw/💿/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 793.0±0.56µs 797.3±1.31µs 1261 tx/sec 1254 tx/sec
stdb_raw/🧠/update_bulk/u32_u64_str/unique_0/load=2048/count=256 828.6±0.55µs 833.5±1.02µs 1206 tx/sec 1199 tx/sec
stdb_raw/🧠/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 593.8±0.84µs 601.4±0.38µs 1684 tx/sec 1662 tx/sec

@github-actions
Copy link

@github-actions github-actions bot commented on 6e088a7 Feb 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark results <title>502 Bad Gateway</title>

502 Bad Gateway


nginx

Please sign in to comment.