Skip to content

Commit

Permalink
Split old datastore more (#770)
Browse files Browse the repository at this point in the history
* 1. sort some `Cargo.toml`s
2. expose 'pointers_yielded'
3. move SequenceError

* datastore: TxId -> tx.rs

* datastore: extract datastore.rs

* fix test imports
  • Loading branch information
Centril authored Jan 28, 2024
1 parent ecd366e commit 145e588
Show file tree
Hide file tree
Showing 10 changed files with 1,670 additions and 1,677 deletions.
17 changes: 9 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ debug = true
ahash = "0.8"
anyhow = { version = "1.0.68", features = ["backtrace"] }
anymap = "0.12"
arrayvec = "0.7.2"
async-trait = "0.1.68"
axum = { version = "0.7", features = ["tracing"] }
axum-extra = { version = "0.9", features = ["typed-header"] }
arrayvec = "0.7.2"
backtrace = "0.3.66"
base64 = "0.21.2"
bitflags = "2.3.3"
Expand Down Expand Up @@ -99,16 +99,16 @@ enum-as-inner = "0.6"
enum-map = "2.6.3"
env_logger = "0.10"
flate2 = "1.0.24"
fs2 = "0.4.3"
fs-err = "2.9.0"
fs2 = "0.4.3"
futures = "0.3"
futures-channel = "0.3"
getrandom = { version = "0.2.7", features = ["custom"] }
glob = "0.3.1"
headers = "0.4"
hex = "0.4.3"
hostname = "^0.3"
home = "0.5"
hostname = "^0.3"
http = "1.0"
humantime = "2.1.0"
hyper = "1.0"
Expand All @@ -119,7 +119,7 @@ indexmap = "2.0.0"
indicatif = "0.16"
insta = { version = "1.21.0", features = ["toml"] }
is-terminal = "0.4"
itertools = "0.12.0"
itertools = "0.12"
jsonwebtoken = { version = "8.1.0" }
lazy_static = "1.4.0"
log = "0.4.17"
Expand All @@ -143,9 +143,9 @@ rayon-core = "1.11.0"
regex = "1"
reqwest = { version = "0.11.10", features = ["stream", "json"] }
rusqlite = { version = "0.29.0", features = ["bundled", "column_decltype"] }
rust_decimal = { version = "1.29.1", features = ["db-tokio-postgres"] }
rustc-demangle = "0.1.21"
rustc-hash = "1.1.0"
rust_decimal = { version = "1.29.1", features = ["db-tokio-postgres"] }
rustyline = { version = "12.0.0", features = [] }
scoped-tls = "1.0.1"
scopeguard = "1.1.0"
Expand All @@ -160,9 +160,9 @@ sha3 = "0.10.0"
slab = "0.4.7"
sled = "0.34.7"
smallvec = { version = "1.11", features = ["union", "const_generics"] }
sqlparser = "0.38.0"
sqllogictest-engines = "0.17"
sqllogictest = "0.17"
sqllogictest-engines = "0.17"
sqlparser = "0.38.0"
strum = { version = "0.25.0", features = ["derive"] }
syn = { version = "2", features = ["full", "extra-traits"] }
syntect = { version = "5.0.0", default-features = false, features = ["default-fancy"] }
Expand All @@ -173,9 +173,9 @@ tempfile = "3.8"
termcolor = "1.2.0"
thiserror = "1.0.37"
tokio = { version = "1.25.1", features = ["full"] }
tokio-util = { version = "0.7.4", features = ["time"] }
tokio-postgres = { version = "0.7.8", features = ["with-chrono-0_4"] }
tokio-tungstenite = { version = "0.21", features = ["native-tls"] }
tokio-util = { version = "0.7.4", features = ["time"] }
toml = "0.8"
tower-http = { version = "0.5", features = ["cors"] }
tracing = { version = "0.1.37", features = ["release_max_level_off"] }
Expand All @@ -190,6 +190,7 @@ uuid = { version = "1.2.1", features = ["v4"] }
walkdir = "2.2.5"
wasmbin = "0.6"


wasmtime = { version = "15", default-features = false, features = ["cranelift", "demangle", "addr2line", "cache"] }

# We use the "ondemand" feature to allow connecting after the start,
Expand Down
2 changes: 1 addition & 1 deletion crates/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ rayon-core.workspace = true
regex.workspace = true
rustc-demangle.workspace = true
rustc-hash.workspace = true
smallvec.workspace = true
scopeguard.workspace = true
sendgrid.workspace = true
serde.workspace = true
Expand All @@ -72,6 +71,7 @@ serde_with = { workspace = true, features = ["chrono_0_4"] }
sha1.workspace = true
slab.workspace = true
sled.workspace = true
smallvec.workspace = true
sqlparser.workspace = true
strum.workspace = true
tempfile.workspace = true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use super::{
btree_index::{BTreeIndex, BTreeIndexRangeIter},
datastore::{DataRef, RowId},
sequence::{Sequence, SequencesState},
state_view::StateView,
state_view::{Iter, IterByColRange, ScanIterByColRange, StateView},
table::Table,
tx_state::TxState,
DataRef, Iter, IterByColRange, RowId, ScanIterByColRange,
};
use crate::{
db::{
Expand Down
Loading

1 comment on commit 145e588

@github-actions
Copy link

@github-actions github-actions bot commented on 145e588 Jan 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 💿 442.8±2.08ns 438.2±1.79ns - -
sqlite 🧠 435.5±2.44ns 432.4±1.62ns - -
stdb_module 💿 20.5±1.59µs 20.1±1.50µs - -
stdb_module 🧠 19.6±0.94µs 19.9±1.02µs - -
stdb_raw 💿 943.1±1.60ns 932.8±1.98ns - -
stdb_raw 🧠 896.0±1.97ns 880.1±1.86ns - -

Single-row insertions

db on disk schema index type load new latency old latency new throughput old throughput
sqlite 💿 location multi_index 0 14.4±0.04µs 14.9±0.04µs 67.7 Ktx/sec 65.6 Ktx/sec
sqlite 💿 location multi_index 1000 15.7±0.12µs 15.7±0.11µs 62.1 Ktx/sec 62.2 Ktx/sec
sqlite 💿 location non_unique 0 7.1±0.03µs 7.2±0.52µs 138.5 Ktx/sec 135.6 Ktx/sec
sqlite 💿 location non_unique 1000 7.0±0.04µs 7.0±0.04µs 140.4 Ktx/sec 139.5 Ktx/sec
sqlite 💿 location unique 0 7.0±0.04µs 7.2±0.05µs 138.9 Ktx/sec 135.1 Ktx/sec
sqlite 💿 location unique 1000 7.0±0.05µs 7.1±0.04µs 139.7 Ktx/sec 138.5 Ktx/sec
sqlite 💿 person multi_index 0 14.3±0.05µs 14.6±0.05µs 68.4 Ktx/sec 66.8 Ktx/sec
sqlite 💿 person multi_index 1000 16.0±0.11µs 16.2±0.09µs 61.0 Ktx/sec 60.4 Ktx/sec
sqlite 💿 person non_unique 0 7.1±0.09µs 7.3±0.11µs 136.8 Ktx/sec 134.0 Ktx/sec
sqlite 💿 person non_unique 1000 7.1±0.04µs 7.2±0.05µs 137.5 Ktx/sec 136.0 Ktx/sec
sqlite 💿 person unique 0 7.1±0.03µs 7.2±0.05µs 137.0 Ktx/sec 134.8 Ktx/sec
sqlite 💿 person unique 1000 7.2±0.05µs 7.3±0.07µs 136.0 Ktx/sec 134.7 Ktx/sec
sqlite 🧠 location multi_index 0 4.2±0.02µs 4.1±0.03µs 234.1 Ktx/sec 236.7 Ktx/sec
sqlite 🧠 location multi_index 1000 5.3±0.05µs 5.3±0.05µs 185.3 Ktx/sec 183.3 Ktx/sec
sqlite 🧠 location non_unique 0 1848.3±6.78ns 1867.3±13.52ns 528.4 Ktx/sec 523.0 Ktx/sec
sqlite 🧠 location non_unique 1000 1920.8±17.10ns 1945.3±20.17ns 508.4 Ktx/sec 502.0 Ktx/sec
sqlite 🧠 location unique 0 1839.5±7.66ns 1848.2±8.30ns 530.9 Ktx/sec 528.4 Ktx/sec
sqlite 🧠 location unique 1000 1983.4±16.25ns 1973.1±47.37ns 492.4 Ktx/sec 494.9 Ktx/sec
sqlite 🧠 person multi_index 0 3.7±0.01µs 3.7±0.01µs 265.2 Ktx/sec 261.1 Ktx/sec
sqlite 🧠 person multi_index 1000 5.5±0.03µs 5.5±0.02µs 178.3 Ktx/sec 176.2 Ktx/sec
sqlite 🧠 person non_unique 0 1902.4±6.89ns 1952.3±6.16ns 513.3 Ktx/sec 500.2 Ktx/sec
sqlite 🧠 person non_unique 1000 2.0±0.02µs 2.0±0.01µs 487.6 Ktx/sec 487.6 Ktx/sec
sqlite 🧠 person unique 0 1883.7±12.96ns 1939.6±7.69ns 518.4 Ktx/sec 503.5 Ktx/sec
sqlite 🧠 person unique 1000 2.0±0.02µs 2.0±0.01µs 482.5 Ktx/sec 480.2 Ktx/sec
stdb_module 💿 location multi_index 0 54.3±5.17µs 57.5±5.63µs 18.0 Ktx/sec 17.0 Ktx/sec
stdb_module 💿 location multi_index 1000 50.4±4.81µs 56.4±4.44µs 19.4 Ktx/sec 17.3 Ktx/sec
stdb_module 💿 location non_unique 0 44.8±4.32µs 47.0±4.48µs 21.8 Ktx/sec 20.8 Ktx/sec
stdb_module 💿 location non_unique 1000 71.6±17.43µs 91.4±56.85µs 13.6 Ktx/sec 10.7 Ktx/sec
stdb_module 💿 location unique 0 50.7±3.58µs 55.3±5.43µs 19.2 Ktx/sec 17.6 Ktx/sec
stdb_module 💿 location unique 1000 80.3±53.80µs 127.5±23.13µs 12.2 Ktx/sec 7.7 Ktx/sec
stdb_module 💿 person multi_index 0 71.8±5.24µs 68.7±5.58µs 13.6 Ktx/sec 14.2 Ktx/sec
stdb_module 💿 person multi_index 1000 139.4±53.86µs 231.6±63.99µs 7.0 Ktx/sec 4.2 Ktx/sec
stdb_module 💿 person non_unique 0 52.3±4.24µs 57.6±5.03µs 18.7 Ktx/sec 16.9 Ktx/sec
stdb_module 💿 person non_unique 1000 107.1±9.56µs 121.4±65.63µs 9.1 Ktx/sec 8.0 Ktx/sec
stdb_module 💿 person unique 0 61.3±3.49µs 60.5±4.63µs 15.9 Ktx/sec 16.1 Ktx/sec
stdb_module 💿 person unique 1000 160.2±1.68µs 249.8±17.54µs 6.1 Ktx/sec 3.9 Ktx/sec
stdb_module 🧠 location multi_index 0 44.0±4.20µs 44.0±4.83µs 22.2 Ktx/sec 22.2 Ktx/sec
stdb_module 🧠 location multi_index 1000 133.2±72.45µs 72.9±13.27µs 7.3 Ktx/sec 13.4 Ktx/sec
stdb_module 🧠 location non_unique 0 36.0±4.14µs 33.1±2.89µs 27.1 Ktx/sec 29.5 Ktx/sec
stdb_module 🧠 location non_unique 1000 122.6±12.39µs 77.1±22.10µs 8.0 Ktx/sec 12.7 Ktx/sec
stdb_module 🧠 location unique 0 39.9±3.38µs 43.3±4.52µs 24.5 Ktx/sec 22.5 Ktx/sec
stdb_module 🧠 location unique 1000 102.3±17.23µs 35.4±2.27µs 9.6 Ktx/sec 27.6 Ktx/sec
stdb_module 🧠 person multi_index 0 53.0±4.79µs 50.8±4.89µs 18.4 Ktx/sec 19.2 Ktx/sec
stdb_module 🧠 person multi_index 1000 64.5±5.24µs 67.6±6.05µs 15.1 Ktx/sec 14.5 Ktx/sec
stdb_module 🧠 person non_unique 0 36.0±2.91µs 37.7±3.31µs 27.1 Ktx/sec 25.9 Ktx/sec
stdb_module 🧠 person non_unique 1000 161.9±106.83µs 223.6±52.24µs 6.0 Ktx/sec 4.4 Ktx/sec
stdb_module 🧠 person unique 0 43.2±5.05µs 45.1±3.59µs 22.6 Ktx/sec 21.6 Ktx/sec
stdb_module 🧠 person unique 1000 116.2±26.93µs 49.7±5.86µs 8.4 Ktx/sec 19.6 Ktx/sec
stdb_raw 💿 location multi_index 0 7.0±0.02µs 7.2±0.02µs 140.0 Ktx/sec 136.0 Ktx/sec
stdb_raw 💿 location multi_index 1000 29.1±192.02µs 29.4±192.73µs 33.6 Ktx/sec 33.3 Ktx/sec
stdb_raw 💿 location non_unique 0 4.8±0.52µs 4.8±0.01µs 201.8 Ktx/sec 201.7 Ktx/sec
stdb_raw 💿 location non_unique 1000 6.6±0.15µs 14.6±80.63µs 148.8 Ktx/sec 66.9 Ktx/sec
stdb_raw 💿 location unique 0 6.1±0.01µs 6.2±0.06µs 160.8 Ktx/sec 158.0 Ktx/sec
stdb_raw 💿 location unique 1000 26.5±179.85µs 26.6±179.54µs 36.9 Ktx/sec 36.7 Ktx/sec
stdb_raw 💿 person multi_index 0 11.3±0.02µs 11.5±0.02µs 86.7 Ktx/sec 85.2 Ktx/sec
stdb_raw 💿 person multi_index 1000 14.7±0.19µs 47.1±323.14µs 66.4 Ktx/sec 20.7 Ktx/sec
stdb_raw 💿 person non_unique 0 5.9±0.01µs 6.1±0.36µs 165.3 Ktx/sec 161.3 Ktx/sec
stdb_raw 💿 person non_unique 1000 12.7±47.90µs 7.9±0.08µs 76.8 Ktx/sec 124.1 Ktx/sec
stdb_raw 💿 person unique 0 8.2±0.30µs 8.3±0.03µs 118.9 Ktx/sec 117.7 Ktx/sec
stdb_raw 💿 person unique 1000 11.4±3.96µs 38.9±277.90µs 85.5 Ktx/sec 25.1 Ktx/sec
stdb_raw 🧠 location multi_index 0 4.5±0.00µs 4.6±0.01µs 216.8 Ktx/sec 211.6 Ktx/sec
stdb_raw 🧠 location multi_index 1000 6.1±0.05µs 6.4±0.03µs 159.0 Ktx/sec 153.2 Ktx/sec
stdb_raw 🧠 location non_unique 0 2.3±0.00µs 2.4±0.02µs 416.4 Ktx/sec 412.6 Ktx/sec
stdb_raw 🧠 location non_unique 1000 3.0±0.01µs 3.0±0.02µs 325.1 Ktx/sec 324.4 Ktx/sec
stdb_raw 🧠 location unique 0 3.6±0.01µs 3.7±0.01µs 272.7 Ktx/sec 266.6 Ktx/sec
stdb_raw 🧠 location unique 1000 4.8±0.03µs 4.9±0.05µs 205.0 Ktx/sec 199.1 Ktx/sec
stdb_raw 🧠 person multi_index 0 8.2±0.01µs 8.3±0.01µs 119.7 Ktx/sec 118.3 Ktx/sec
stdb_raw 🧠 person multi_index 1000 10.2±0.09µs 10.5±0.07µs 96.1 Ktx/sec 93.4 Ktx/sec
stdb_raw 🧠 person non_unique 0 2.9±0.01µs 2.9±0.01µs 334.7 Ktx/sec 334.3 Ktx/sec
stdb_raw 🧠 person non_unique 1000 3.7±0.02µs 3.7±0.02µs 263.7 Ktx/sec 260.6 Ktx/sec
stdb_raw 🧠 person unique 0 5.2±0.01µs 5.2±0.00µs 189.6 Ktx/sec 188.3 Ktx/sec
stdb_raw 🧠 person unique 1000 6.5±0.05µs 6.8±0.05µs 149.7 Ktx/sec 144.2 Ktx/sec

Multi-row insertions

db on disk schema index type load count new latency old latency new throughput old throughput
sqlite 💿 location multi_index 0 100 132.1±3.65µs 133.4±3.45µs 7.4 Ktx/sec 7.3 Ktx/sec
sqlite 💿 location multi_index 1000 100 205.1±1.65µs 205.5±1.23µs 4.8 Ktx/sec 4.8 Ktx/sec
sqlite 💿 location non_unique 0 100 49.6±1.35µs 50.5±1.47µs 19.7 Ktx/sec 19.4 Ktx/sec
sqlite 💿 location non_unique 1000 100 51.8±0.45µs 52.2±0.22µs 18.9 Ktx/sec 18.7 Ktx/sec
sqlite 💿 location unique 0 100 52.2±1.31µs 52.9±0.56µs 18.7 Ktx/sec 18.5 Ktx/sec
sqlite 💿 location unique 1000 100 57.2±0.29µs 57.1±0.25µs 17.1 Ktx/sec 17.1 Ktx/sec
sqlite 💿 person multi_index 0 100 116.9±0.65µs 119.1±3.19µs 8.4 Ktx/sec 8.2 Ktx/sec
sqlite 💿 person multi_index 1000 100 228.2±0.67µs 228.9±0.55µs 4.3 Ktx/sec 4.3 Ktx/sec
sqlite 💿 person non_unique 0 100 47.0±1.01µs 49.5±2.54µs 20.8 Ktx/sec 19.7 Ktx/sec
sqlite 💿 person non_unique 1000 100 58.4±0.28µs 60.9±0.30µs 16.7 Ktx/sec 16.0 Ktx/sec
sqlite 💿 person unique 0 100 50.3±8.43µs 50.6±0.96µs 19.4 Ktx/sec 19.3 Ktx/sec
sqlite 💿 person unique 1000 100 54.7±0.34µs 56.3±0.32µs 17.9 Ktx/sec 17.3 Ktx/sec
sqlite 🧠 location multi_index 0 100 120.0±0.70µs 121.5±1.05µs 8.1 Ktx/sec 8.0 Ktx/sec
sqlite 🧠 location multi_index 1000 100 170.5±0.38µs 171.8±0.48µs 5.7 Ktx/sec 5.7 Ktx/sec
sqlite 🧠 location non_unique 0 100 43.4±0.35µs 43.6±0.36µs 22.5 Ktx/sec 22.4 Ktx/sec
sqlite 🧠 location non_unique 1000 100 44.5±0.37µs 44.4±0.67µs 22.0 Ktx/sec 22.0 Ktx/sec
sqlite 🧠 location unique 0 100 46.1±0.40µs 47.5±0.29µs 21.2 Ktx/sec 20.6 Ktx/sec
sqlite 🧠 location unique 1000 100 48.9±0.37µs 49.1±0.78µs 20.0 Ktx/sec 19.9 Ktx/sec
sqlite 🧠 person multi_index 0 100 105.5±0.59µs 107.6±0.41µs 9.3 Ktx/sec 9.1 Ktx/sec
sqlite 🧠 person multi_index 1000 100 188.5±0.23µs 190.2±0.36µs 5.2 Ktx/sec 5.1 Ktx/sec
sqlite 🧠 person non_unique 0 100 41.1±0.64µs 43.0±0.29µs 23.7 Ktx/sec 22.7 Ktx/sec
sqlite 🧠 person non_unique 1000 100 44.0±0.21µs 45.5±0.54µs 22.2 Ktx/sec 21.5 Ktx/sec
sqlite 🧠 person unique 0 100 43.1±0.36µs 44.5±0.45µs 22.7 Ktx/sec 22.0 Ktx/sec
sqlite 🧠 person unique 1000 100 46.9±0.29µs 48.2±0.76µs 20.8 Ktx/sec 20.3 Ktx/sec
stdb_module 💿 location multi_index 0 100 822.7±276.68µs 867.5±19.18µs 1215 tx/sec 1152 tx/sec
stdb_module 💿 location multi_index 1000 100 777.7±78.90µs 845.0±41.68µs 1285 tx/sec 1183 tx/sec
stdb_module 💿 location non_unique 0 100 465.6±23.90µs 449.0±15.91µs 2.1 Ktx/sec 2.2 Ktx/sec
stdb_module 💿 location non_unique 1000 100 489.0±15.77µs 522.4±46.78µs 2044 tx/sec 1914 tx/sec
stdb_module 💿 location unique 0 100 542.6±74.86µs 621.2±56.03µs 1843 tx/sec 1609 tx/sec
stdb_module 💿 location unique 1000 100 789.7±70.69µs 777.3±68.64µs 1266 tx/sec 1286 tx/sec
stdb_module 💿 person multi_index 0 100 925.6±28.97µs 1129.3±184.78µs 1080 tx/sec 885 tx/sec
stdb_module 💿 person multi_index 1000 100 1012.9±4.12µs 1152.5±34.08µs 987 tx/sec 867 tx/sec
stdb_module 💿 person non_unique 0 100 627.5±48.61µs 611.1±65.25µs 1593 tx/sec 1636 tx/sec
stdb_module 💿 person non_unique 1000 100 668.3±80.44µs 785.2±69.46µs 1496 tx/sec 1273 tx/sec
stdb_module 💿 person unique 0 100 711.2±111.86µs 793.8±66.48µs 1406 tx/sec 1259 tx/sec
stdb_module 💿 person unique 1000 100 717.9±1.47µs 735.1±70.19µs 1392 tx/sec 1360 tx/sec
stdb_module 🧠 location multi_index 0 100 432.9±2.76µs 701.9±103.43µs 2.3 Ktx/sec 1424 tx/sec
stdb_module 🧠 location multi_index 1000 100 665.8±122.49µs 780.4±7.23µs 1501 tx/sec 1281 tx/sec
stdb_module 🧠 location non_unique 0 100 208.6±9.69µs 369.2±6.86µs 4.7 Ktx/sec 2.6 Ktx/sec
stdb_module 🧠 location non_unique 1000 100 333.6±10.72µs 495.4±5.02µs 2.9 Ktx/sec 2018 tx/sec
stdb_module 🧠 location unique 0 100 493.2±86.89µs 413.4±26.23µs 2027 tx/sec 2.4 Ktx/sec
stdb_module 🧠 location unique 1000 100 588.6±11.79µs 643.8±17.02µs 1698 tx/sec 1553 tx/sec
stdb_module 🧠 person multi_index 0 100 906.7±6.04µs 797.0±6.74µs 1102 tx/sec 1254 tx/sec
stdb_module 🧠 person multi_index 1000 100 954.5±14.85µs 990.7±4.80µs 1047 tx/sec 1009 tx/sec
stdb_module 🧠 person non_unique 0 100 300.2±26.96µs 372.5±1.58µs 3.3 Ktx/sec 2.6 Ktx/sec
stdb_module 🧠 person non_unique 1000 100 500.1±65.38µs 462.7±44.94µs 1999 tx/sec 2.1 Ktx/sec
stdb_module 🧠 person unique 0 100 555.7±37.98µs 510.8±14.06µs 1799 tx/sec 1957 tx/sec
stdb_module 🧠 person unique 1000 100 633.2±49.29µs 681.0±2.04µs 1579 tx/sec 1468 tx/sec
stdb_raw 💿 location multi_index 0 100 329.8±1.20µs 343.1±9.80µs 3.0 Ktx/sec 2.8 Ktx/sec
stdb_raw 💿 location multi_index 1000 100 371.4±191.12µs 394.1±274.07µs 2.6 Ktx/sec 2.5 Ktx/sec
stdb_raw 💿 location non_unique 0 100 119.7±0.33µs 120.8±0.25µs 8.2 Ktx/sec 8.1 Ktx/sec
stdb_raw 💿 location non_unique 1000 100 121.9±0.93µs 133.8±113.76µs 8.0 Ktx/sec 7.3 Ktx/sec
stdb_raw 💿 location unique 0 100 237.8±6.64µs 243.3±0.80µs 4.1 Ktx/sec 4.0 Ktx/sec
stdb_raw 💿 location unique 1000 100 263.0±85.36µs 260.8±1.29µs 3.7 Ktx/sec 3.7 Ktx/sec
stdb_raw 💿 person multi_index 0 100 697.8±0.56µs 705.6±1.37µs 1433 tx/sec 1417 tx/sec
stdb_raw 💿 person multi_index 1000 100 756.3±336.69µs 774.9±370.91µs 1322 tx/sec 1290 tx/sec
stdb_raw 💿 person non_unique 0 100 219.5±0.19µs 220.1±2.16µs 4.4 Ktx/sec 4.4 Ktx/sec
stdb_raw 💿 person non_unique 1000 100 222.4±0.34µs 222.8±0.95µs 4.4 Ktx/sec 4.4 Ktx/sec
stdb_raw 💿 person unique 0 100 422.0±0.24µs 429.7±0.86µs 2.3 Ktx/sec 2.3 Ktx/sec
stdb_raw 💿 person unique 1000 100 467.7±270.93µs 446.6±0.74µs 2.1 Ktx/sec 2.2 Ktx/sec
stdb_raw 🧠 location multi_index 0 100 283.3±0.55µs 293.2±0.38µs 3.4 Ktx/sec 3.3 Ktx/sec
stdb_raw 🧠 location multi_index 1000 100 306.7±0.42µs 317.2±0.42µs 3.2 Ktx/sec 3.1 Ktx/sec
stdb_raw 🧠 location non_unique 0 100 73.3±0.10µs 74.3±0.13µs 13.3 Ktx/sec 13.1 Ktx/sec
stdb_raw 🧠 location non_unique 1000 100 74.8±0.10µs 75.3±0.11µs 13.1 Ktx/sec 13.0 Ktx/sec
stdb_raw 🧠 location unique 0 100 191.0±0.56µs 196.2±0.26µs 5.1 Ktx/sec 5.0 Ktx/sec
stdb_raw 🧠 location unique 1000 100 207.3±0.20µs 214.6±0.39µs 4.7 Ktx/sec 4.6 Ktx/sec
stdb_raw 🧠 person multi_index 0 100 601.8±0.74µs 618.0±0.40µs 1661 tx/sec 1618 tx/sec
stdb_raw 🧠 person multi_index 1000 100 627.0±1.86µs 646.4±0.92µs 1594 tx/sec 1547 tx/sec
stdb_raw 🧠 person non_unique 0 100 125.8±0.14µs 126.5±0.09µs 7.8 Ktx/sec 7.7 Ktx/sec
stdb_raw 🧠 person non_unique 1000 100 127.6±0.29µs 128.6±0.35µs 7.7 Ktx/sec 7.6 Ktx/sec
stdb_raw 🧠 person unique 0 100 327.9±0.46µs 335.8±0.51µs 3.0 Ktx/sec 2.9 Ktx/sec
stdb_raw 🧠 person unique 1000 100 344.0±0.56µs 352.2±0.29µs 2.8 Ktx/sec 2.8 Ktx/sec

Full table iterate

db on disk schema index type new latency old latency new throughput old throughput
sqlite 💿 location unique 8.7±0.05µs 9.0±0.05µs 112.8 Ktx/sec 107.9 Ktx/sec
sqlite 💿 person unique 9.1±0.04µs 9.2±0.11µs 107.6 Ktx/sec 106.1 Ktx/sec
sqlite 🧠 location unique 7.5±0.04µs 7.9±0.05µs 130.1 Ktx/sec 123.3 Ktx/sec
sqlite 🧠 person unique 7.9±0.04µs 8.2±0.07µs 124.4 Ktx/sec 119.1 Ktx/sec
stdb_module 💿 location unique 47.4±10.35µs 49.7±8.96µs 20.6 Ktx/sec 19.6 Ktx/sec
stdb_module 💿 person unique 49.4±5.75µs 57.2±10.72µs 19.8 Ktx/sec 17.1 Ktx/sec
stdb_module 🧠 location unique 48.7±8.61µs 48.2±8.33µs 20.1 Ktx/sec 20.3 Ktx/sec
stdb_module 🧠 person unique 61.6±12.42µs 60.7±11.30µs 15.8 Ktx/sec 16.1 Ktx/sec
stdb_raw 💿 location unique 9.0±0.02µs 9.1±0.01µs 108.9 Ktx/sec 107.5 Ktx/sec
stdb_raw 💿 person unique 9.0±0.02µs 9.1±0.01µs 108.9 Ktx/sec 107.5 Ktx/sec
stdb_raw 🧠 location unique 8.9±0.01µs 9.0±0.01µs 109.7 Ktx/sec 108.0 Ktx/sec
stdb_raw 🧠 person unique 8.9±0.16µs 9.1±0.39µs 109.3 Ktx/sec 107.3 Ktx/sec

Find unique key

db on disk key type load new latency old latency new throughput old throughput
sqlite 💿 u32 1000 2.3±0.01µs 2.3±0.01µs 423.9 Ktx/sec 420.1 Ktx/sec
sqlite 🧠 u32 1000 1119.1±6.02ns 1138.4±3.64ns 872.6 Ktx/sec 857.8 Ktx/sec
stdb_module 💿 u32 1000 29.3±2.28µs 30.6±1.98µs 33.3 Ktx/sec 31.9 Ktx/sec
stdb_module 🧠 u32 1000 28.8±1.89µs 30.5±2.24µs 33.9 Ktx/sec 32.0 Ktx/sec
stdb_raw 💿 u32 1000 2.2±0.00µs 2.2±0.01µs 435.0 Ktx/sec 437.4 Ktx/sec
stdb_raw 🧠 u32 1000 2.2±0.00µs 2.2±0.00µs 449.2 Ktx/sec 452.1 Ktx/sec

Filter

db on disk key type index strategy load count new latency old latency new throughput old throughput
sqlite 💿 string indexed 1000 10 5.6±0.06µs 5.6±0.01µs 174.9 Ktx/sec 175.8 Ktx/sec
sqlite 💿 string non_indexed 1000 10 50.9±0.33µs 50.7±0.41µs 19.2 Ktx/sec 19.3 Ktx/sec
sqlite 💿 u64 indexed 1000 10 5.4±0.03µs 5.4±0.02µs 181.7 Ktx/sec 180.8 Ktx/sec
sqlite 💿 u64 non_indexed 1000 10 33.2±0.17µs 33.2±0.08µs 29.4 Ktx/sec 29.4 Ktx/sec
sqlite 🧠 string indexed 1000 10 4.2±0.02µs 4.2±0.02µs 233.5 Ktx/sec 234.8 Ktx/sec
sqlite 🧠 string non_indexed 1000 10 49.6±0.18µs 49.2±0.42µs 19.7 Ktx/sec 19.9 Ktx/sec
sqlite 🧠 u64 indexed 1000 10 4.0±0.02µs 4.0±0.01µs 243.3 Ktx/sec 244.3 Ktx/sec
sqlite 🧠 u64 non_indexed 1000 10 32.0±0.19µs 31.9±0.09µs 30.5 Ktx/sec 30.6 Ktx/sec
stdb_module 💿 string indexed 1000 10 37.0±3.14µs 40.1±4.11µs 26.4 Ktx/sec 24.3 Ktx/sec
stdb_module 💿 string non_indexed 1000 10 175.3±1.01µs 163.3±1.74µs 5.6 Ktx/sec 6.0 Ktx/sec
stdb_module 💿 u64 indexed 1000 10 36.4±3.43µs 38.1±3.89µs 26.9 Ktx/sec 25.6 Ktx/sec
stdb_module 💿 u64 non_indexed 1000 10 147.7±6.05µs 133.1±1.67µs 6.6 Ktx/sec 7.3 Ktx/sec
stdb_module 🧠 string indexed 1000 10 40.0±3.01µs 39.1±2.56µs 24.4 Ktx/sec 25.0 Ktx/sec
stdb_module 🧠 string non_indexed 1000 10 179.3±6.81µs 165.6±4.24µs 5.4 Ktx/sec 5.9 Ktx/sec
stdb_module 🧠 u64 indexed 1000 10 35.9±2.77µs 36.3±2.73µs 27.2 Ktx/sec 26.9 Ktx/sec
stdb_module 🧠 u64 non_indexed 1000 10 144.4±2.16µs 132.0±0.95µs 6.8 Ktx/sec 7.4 Ktx/sec
stdb_raw 💿 string indexed 1000 10 4.8±0.01µs 4.9±0.02µs 203.0 Ktx/sec 200.3 Ktx/sec
stdb_raw 💿 string non_indexed 1000 10 126.5±0.21µs 120.7±0.42µs 7.7 Ktx/sec 8.1 Ktx/sec
stdb_raw 💿 u64 indexed 1000 10 4.7±0.01µs 4.8±0.02µs 206.5 Ktx/sec 204.3 Ktx/sec
stdb_raw 💿 u64 non_indexed 1000 10 103.7±0.15µs 105.3±0.10µs 9.4 Ktx/sec 9.3 Ktx/sec
stdb_raw 🧠 string indexed 1000 10 4.7±0.01µs 4.8±0.01µs 205.8 Ktx/sec 203.4 Ktx/sec
stdb_raw 🧠 string non_indexed 1000 10 126.2±0.99µs 120.3±0.26µs 7.7 Ktx/sec 8.1 Ktx/sec
stdb_raw 🧠 u64 indexed 1000 10 4.7±0.01µs 4.7±0.05µs 208.9 Ktx/sec 206.4 Ktx/sec
stdb_raw 🧠 u64 non_indexed 1000 10 103.6±0.24µs 105.4±0.33µs 9.4 Ktx/sec 9.3 Ktx/sec

Serialize

schema format count new latency old latency new throughput old throughput
location bsatn 100 1852.2±31.80ns 1667.4±92.55ns 51.5 Mtx/sec 57.2 Mtx/sec
location json 100 3.9±0.01µs 3.4±0.05µs 24.2 Mtx/sec 28.2 Mtx/sec
location product_value 100 549.6±1.25ns 550.2±2.17ns 173.5 Mtx/sec 173.3 Mtx/sec
person bsatn 100 2.6±0.01µs 2.8±0.02µs 36.6 Mtx/sec 34.2 Mtx/sec
person json 100 5.7±0.02µs 5.1±0.02µs 16.8 Mtx/sec 18.8 Mtx/sec
person product_value 100 666.8±1.99ns 667.4±17.13ns 143.0 Mtx/sec 142.9 Mtx/sec

Module: invoke with large arguments

arg size new latency old latency new throughput old throughput
64KiB 59.9±11.50µs 56.8±7.14µs - -

Module: print bulk

line count new latency old latency new throughput old throughput
1 28.8±2.27µs 29.7±2.58µs - -
100 203.9±4.46µs 202.4±4.14µs - -
1000 1856.1±91.06µs 1854.0±59.68µs - -

Remaining benchmarks

name new latency old latency new throughput old throughput

Please sign in to comment.