Skip to content

Commit

Permalink
Error for no abi version (#580)
Browse files Browse the repository at this point in the history
  • Loading branch information
coolreader18 authored Nov 21, 2023
1 parent 15a461e commit 449a988
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
19 changes: 8 additions & 11 deletions crates/core/src/host/wasm_common/abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const MODULE_PREFIX: &str = "spacetime_";
pub fn determine_spacetime_abi<I>(
imports: impl IntoIterator<Item = I>,
get_module: impl Fn(&I) -> &str,
) -> Result<Option<VersionTuple>, AbiVersionError> {
) -> Result<VersionTuple, AbiVersionError> {
let it = imports.into_iter().filter_map(|imp| {
let s = get_module(&imp);
let err = || AbiVersionError::Parse { module: s.to_owned() };
Expand All @@ -15,16 +15,10 @@ pub fn determine_spacetime_abi<I>(
Ok(VersionTuple { major, minor })
})
});
itertools::process_results(it, |mut it| try_reduce(&mut it, refine_ver_req))?
}

// TODO: replace with Iterator::try_reduce once stabilized
fn try_reduce<I: Iterator, E>(
it: &mut I,
f: impl FnMut(I::Item, I::Item) -> Result<I::Item, E>,
) -> Result<Option<I::Item>, E> {
let Some(first) = it.next() else { return Ok(None) };
it.try_fold(first, f).map(Some)
itertools::process_results(it, |mut it| {
let first = it.next().ok_or(AbiVersionError::NotDetected)?;
it.try_fold(first, refine_ver_req)
})?
}

fn refine_ver_req(ver: VersionTuple, new: VersionTuple) -> Result<VersionTuple, AbiVersionError> {
Expand Down Expand Up @@ -54,4 +48,7 @@ pub enum AbiVersionError {
got: VersionTuple,
implements: VersionTuple,
},
// TODO: (by 1.0, maybe) remove the parenthetical from this error message
#[error("unable to determine ABI of module (may be on an spacetime version < 0.8)")]
NotDetected,
}
4 changes: 1 addition & 3 deletions crates/core/src/host/wasmtime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,7 @@ pub fn make_actor(
.filter(|imp| matches!(imp.ty(), wasmtime::ExternType::Func(_)));
let abi = abi::determine_spacetime_abi(func_imports, |imp| imp.module())?;

if let Some(abi) = abi {
abi::verify_supported(WasmtimeModule::IMPLEMENTED_ABI, abi)?;
}
abi::verify_supported(WasmtimeModule::IMPLEMENTED_ABI, abi)?;

let module = LINKER
.instantiate_pre(&module)
Expand Down

1 comment on commit 449a988

@github-actions
Copy link

@github-actions github-actions bot commented on 449a988 Nov 21, 2023

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 💿 433.0±3.65ns 440.2±3.59ns - -
sqlite 🧠 422.3±3.77ns 438.1±2.78ns - -
stdb_module 💿 17.7±1.10µs 18.0±1.27µs - -
stdb_module 🧠 17.9±1.08µs 17.7±1.22µs - -
stdb_raw 💿 727.4±1.56ns 738.9±2.05ns - -
stdb_raw 🧠 677.1±1.11ns 686.2±0.99ns - -

Single-row insertions

db on disk schema index type load new latency old latency new throughput old throughput
sqlite 💿 location multi_index 0 14.5±0.03µs 14.5±0.03µs 67.1 Ktx/sec 67.2 Ktx/sec
sqlite 💿 location multi_index 1000 15.8±0.14µs 15.9±0.11µs 61.6 Ktx/sec 61.5 Ktx/sec
sqlite 💿 location non_unique 0 7.4±0.33µs 7.2±0.08µs 132.5 Ktx/sec 136.1 Ktx/sec
sqlite 💿 location non_unique 1000 7.2±0.06µs 7.1±0.03µs 135.3 Ktx/sec 138.3 Ktx/sec
sqlite 💿 location unique 0 7.3±0.04µs 7.3±0.45µs 134.7 Ktx/sec 134.5 Ktx/sec
sqlite 💿 location unique 1000 7.3±0.08µs 7.1±0.03µs 134.5 Ktx/sec 137.6 Ktx/sec
sqlite 💿 person multi_index 0 14.4±0.13µs 14.5±0.17µs 68.0 Ktx/sec 67.2 Ktx/sec
sqlite 💿 person multi_index 1000 16.1±0.17µs 16.0±0.09µs 60.6 Ktx/sec 60.9 Ktx/sec
sqlite 💿 person non_unique 0 7.4±0.42µs 7.3±0.44µs 132.5 Ktx/sec 134.6 Ktx/sec
sqlite 💿 person non_unique 1000 7.3±0.03µs 7.3±0.04µs 133.7 Ktx/sec 133.9 Ktx/sec
sqlite 💿 person unique 0 7.4±0.44µs 7.2±0.31µs 132.5 Ktx/sec 135.0 Ktx/sec
sqlite 💿 person unique 1000 7.3±0.12µs 7.3±0.11µs 133.0 Ktx/sec 134.0 Ktx/sec
sqlite 🧠 location multi_index 0 4.1±0.01µs 4.0±0.01µs 238.8 Ktx/sec 243.7 Ktx/sec
sqlite 🧠 location multi_index 1000 5.3±0.05µs 5.2±0.04µs 183.7 Ktx/sec 187.3 Ktx/sec
sqlite 🧠 location non_unique 0 1871.1±3.60ns 1848.3±12.78ns 521.9 Ktx/sec 528.4 Ktx/sec
sqlite 🧠 location non_unique 1000 1931.2±10.24ns 1924.4±13.10ns 505.7 Ktx/sec 507.5 Ktx/sec
sqlite 🧠 location unique 0 1855.6±5.74ns 1861.0±7.60ns 526.3 Ktx/sec 524.8 Ktx/sec
sqlite 🧠 location unique 1000 1997.2±7.79ns 1944.4±17.55ns 489.0 Ktx/sec 502.3 Ktx/sec
sqlite 🧠 person multi_index 0 3.7±0.04µs 3.7±0.04µs 266.1 Ktx/sec 265.3 Ktx/sec
sqlite 🧠 person multi_index 1000 5.6±0.05µs 5.6±0.03µs 175.7 Ktx/sec 175.4 Ktx/sec
sqlite 🧠 person non_unique 0 1959.0±6.23ns 1934.9±7.30ns 498.5 Ktx/sec 504.7 Ktx/sec
sqlite 🧠 person non_unique 1000 2.0±0.02µs 2.0±0.01µs 477.2 Ktx/sec 487.8 Ktx/sec
sqlite 🧠 person unique 0 1937.9±38.10ns 1915.4±7.19ns 503.9 Ktx/sec 509.8 Ktx/sec
sqlite 🧠 person unique 1000 2.1±0.01µs 2.0±0.02µs 471.0 Ktx/sec 481.0 Ktx/sec
stdb_module 💿 location multi_index 0 51.6±4.85µs 47.9±6.15µs 18.9 Ktx/sec 20.4 Ktx/sec
stdb_module 💿 location multi_index 1000 176.0±9.20µs 258.1±21.98µs 5.6 Ktx/sec 3.8 Ktx/sec
stdb_module 💿 location non_unique 0 47.0±27.65µs 39.3±6.13µs 20.8 Ktx/sec 24.9 Ktx/sec
stdb_module 💿 location non_unique 1000 155.6±9.55µs 316.3±9.90µs 6.3 Ktx/sec 3.1 Ktx/sec
stdb_module 💿 location unique 0 49.1±4.00µs 46.4±4.80µs 19.9 Ktx/sec 21.0 Ktx/sec
stdb_module 💿 location unique 1000 132.2±12.26µs 261.3±3.07µs 7.4 Ktx/sec 3.7 Ktx/sec
stdb_module 💿 person multi_index 0 66.1±5.31µs 60.8±5.51µs 14.8 Ktx/sec 16.1 Ktx/sec
stdb_module 💿 person multi_index 1000 285.2±116.97µs 313.8±11.68µs 3.4 Ktx/sec 3.1 Ktx/sec
stdb_module 💿 person non_unique 0 48.2±4.35µs 46.6±3.52µs 20.3 Ktx/sec 21.0 Ktx/sec
stdb_module 💿 person non_unique 1000 76.6±24.66µs 119.5±61.84µs 12.8 Ktx/sec 8.2 Ktx/sec
stdb_module 💿 person unique 0 58.8±3.91µs 54.0±5.14µs 16.6 Ktx/sec 18.1 Ktx/sec
stdb_module 💿 person unique 1000 185.4±25.72µs 328.1±50.95µs 5.3 Ktx/sec 3.0 Ktx/sec
stdb_module 🧠 location multi_index 0 35.8±3.11µs 38.0±5.14µs 27.3 Ktx/sec 25.7 Ktx/sec
stdb_module 🧠 location multi_index 1000 140.7±20.30µs 158.5±30.05µs 6.9 Ktx/sec 6.2 Ktx/sec
stdb_module 🧠 location non_unique 0 30.6±2.36µs 33.1±2.91µs 31.9 Ktx/sec 29.5 Ktx/sec
stdb_module 🧠 location non_unique 1000 102.6±5.10µs 166.9±30.86µs 9.5 Ktx/sec 5.9 Ktx/sec
stdb_module 🧠 location unique 0 32.5±2.18µs 33.6±2.84µs 30.1 Ktx/sec 29.1 Ktx/sec
stdb_module 🧠 location unique 1000 170.6±26.34µs 234.7±26.15µs 5.7 Ktx/sec 4.2 Ktx/sec
stdb_module 🧠 person multi_index 0 43.8±3.75µs 45.6±4.11µs 22.3 Ktx/sec 21.4 Ktx/sec
stdb_module 🧠 person multi_index 1000 164.7±39.45µs 213.8±66.54µs 5.9 Ktx/sec 4.6 Ktx/sec
stdb_module 🧠 person non_unique 0 34.4±4.03µs 30.7±2.24µs 28.4 Ktx/sec 31.9 Ktx/sec
stdb_module 🧠 person non_unique 1000 258.9±1.96µs 267.0±25.30µs 3.8 Ktx/sec 3.7 Ktx/sec
stdb_module 🧠 person unique 0 39.8±4.21µs 39.6±4.53µs 24.5 Ktx/sec 24.7 Ktx/sec
stdb_module 🧠 person unique 1000 178.9±20.10µs 185.3±17.97µs 5.5 Ktx/sec 5.3 Ktx/sec
stdb_raw 💿 location multi_index 0 6.6±0.02µs 6.6±0.03µs 146.9 Ktx/sec 147.5 Ktx/sec
stdb_raw 💿 location multi_index 1000 34.3±249.16µs 34.4±251.36µs 28.5 Ktx/sec 28.4 Ktx/sec
stdb_raw 💿 location non_unique 0 4.3±0.01µs 4.2±0.01µs 226.0 Ktx/sec 229.9 Ktx/sec
stdb_raw 💿 location non_unique 1000 5.7±0.15µs 5.7±0.17µs 172.6 Ktx/sec 171.9 Ktx/sec
stdb_raw 💿 location unique 0 5.7±0.02µs 5.6±0.01µs 172.0 Ktx/sec 175.4 Ktx/sec
stdb_raw 💿 location unique 1000 8.0±0.17µs 7.9±0.20µs 121.5 Ktx/sec 124.1 Ktx/sec
stdb_raw 💿 person multi_index 0 11.0±0.43µs 10.9±0.42µs 88.4 Ktx/sec 89.2 Ktx/sec
stdb_raw 💿 person multi_index 1000 56.1±417.65µs 56.0±417.24µs 17.4 Ktx/sec 17.4 Ktx/sec
stdb_raw 💿 person non_unique 0 5.5±0.32µs 5.4±0.02µs 177.5 Ktx/sec 180.3 Ktx/sec
stdb_raw 💿 person non_unique 1000 22.7±156.56µs 22.7±155.96µs 43.1 Ktx/sec 43.0 Ktx/sec
stdb_raw 💿 person unique 0 7.9±0.02µs 7.8±0.03µs 124.1 Ktx/sec 125.7 Ktx/sec
stdb_raw 💿 person unique 1000 38.6±281.66µs 10.3±0.15µs 25.3 Ktx/sec 94.6 Ktx/sec
stdb_raw 🧠 location multi_index 0 4.1±0.01µs 4.1±0.01µs 236.8 Ktx/sec 236.5 Ktx/sec
stdb_raw 🧠 location multi_index 1000 5.6±0.04µs 5.8±0.05µs 174.2 Ktx/sec 168.6 Ktx/sec
stdb_raw 🧠 location non_unique 0 1918.1±3.82ns 1925.2±7.77ns 509.1 Ktx/sec 507.3 Ktx/sec
stdb_raw 🧠 location non_unique 1000 2.4±0.01µs 2.4±0.02µs 411.2 Ktx/sec 403.7 Ktx/sec
stdb_raw 🧠 location unique 0 3.1±0.01µs 3.1±0.01µs 313.0 Ktx/sec 313.1 Ktx/sec
stdb_raw 🧠 location unique 1000 4.2±0.04µs 4.3±0.04µs 230.5 Ktx/sec 226.6 Ktx/sec
stdb_raw 🧠 person multi_index 0 7.9±0.02µs 7.8±0.01µs 124.4 Ktx/sec 124.8 Ktx/sec
stdb_raw 🧠 person multi_index 1000 9.9±0.09µs 10.0±0.09µs 98.8 Ktx/sec 97.9 Ktx/sec
stdb_raw 🧠 person non_unique 0 2.4±0.00µs 2.5±0.01µs 398.7 Ktx/sec 396.0 Ktx/sec
stdb_raw 🧠 person non_unique 1000 3.2±0.04µs 3.1±0.03µs 302.1 Ktx/sec 310.9 Ktx/sec
stdb_raw 🧠 person unique 0 4.7±0.01µs 4.7±0.01µs 206.5 Ktx/sec 206.6 Ktx/sec
stdb_raw 🧠 person unique 1000 6.2±0.04µs 6.2±0.06µs 158.4 Ktx/sec 158.5 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.2±0.58µs 133.5±12.43µs 7.4 Ktx/sec 7.3 Ktx/sec
sqlite 💿 location multi_index 1000 100 204.9±23.33µs 203.2±1.15µs 4.8 Ktx/sec 4.8 Ktx/sec
sqlite 💿 location non_unique 0 100 51.5±1.68µs 48.7±0.19µs 19.0 Ktx/sec 20.0 Ktx/sec
sqlite 💿 location non_unique 1000 100 54.2±0.37µs 53.4±0.22µs 18.0 Ktx/sec 18.3 Ktx/sec
sqlite 💿 location unique 0 100 53.8±0.24µs 52.4±0.48µs 18.2 Ktx/sec 18.7 Ktx/sec
sqlite 💿 location unique 1000 100 57.7±0.36µs 57.8±0.23µs 16.9 Ktx/sec 16.9 Ktx/sec
sqlite 💿 person multi_index 0 100 119.0±0.61µs 119.1±4.69µs 8.2 Ktx/sec 8.2 Ktx/sec
sqlite 💿 person multi_index 1000 100 236.0±32.21µs 228.5±0.48µs 4.1 Ktx/sec 4.3 Ktx/sec
sqlite 💿 person non_unique 0 100 49.9±0.22µs 48.7±1.57µs 19.6 Ktx/sec 20.0 Ktx/sec
sqlite 💿 person non_unique 1000 100 61.6±0.28µs 61.3±0.23µs 15.8 Ktx/sec 15.9 Ktx/sec
sqlite 💿 person unique 0 100 52.9±1.99µs 51.0±0.68µs 18.5 Ktx/sec 19.1 Ktx/sec
sqlite 💿 person unique 1000 100 58.3±0.26µs 57.6±0.41µs 16.8 Ktx/sec 17.0 Ktx/sec
sqlite 🧠 location multi_index 0 100 120.6±0.57µs 119.3±0.41µs 8.1 Ktx/sec 8.2 Ktx/sec
sqlite 🧠 location multi_index 1000 100 170.0±0.72µs 170.6±0.68µs 5.7 Ktx/sec 5.7 Ktx/sec
sqlite 🧠 location non_unique 0 100 44.5±0.43µs 43.2±0.27µs 22.0 Ktx/sec 22.6 Ktx/sec
sqlite 🧠 location non_unique 1000 100 46.3±0.35µs 44.9±0.32µs 21.1 Ktx/sec 21.8 Ktx/sec
sqlite 🧠 location unique 0 100 46.2±0.30µs 45.6±0.28µs 21.1 Ktx/sec 21.4 Ktx/sec
sqlite 🧠 location unique 1000 100 50.9±0.37µs 49.3±0.30µs 19.2 Ktx/sec 19.8 Ktx/sec
sqlite 🧠 person multi_index 0 100 108.5±0.36µs 106.9±0.59µs 9.0 Ktx/sec 9.1 Ktx/sec
sqlite 🧠 person multi_index 1000 100 191.2±0.39µs 189.4±0.45µs 5.1 Ktx/sec 5.2 Ktx/sec
sqlite 🧠 person non_unique 0 100 43.3±0.29µs 42.3±0.26µs 22.5 Ktx/sec 23.1 Ktx/sec
sqlite 🧠 person non_unique 1000 100 47.3±0.33µs 46.8±0.31µs 20.6 Ktx/sec 20.8 Ktx/sec
sqlite 🧠 person unique 0 100 46.2±0.29µs 44.7±0.69µs 21.2 Ktx/sec 21.9 Ktx/sec
sqlite 🧠 person unique 1000 100 50.2±0.32µs 49.0±0.28µs 19.5 Ktx/sec 19.9 Ktx/sec
stdb_module 💿 location multi_index 0 100 857.6±34.23µs 692.4±84.76µs 1166 tx/sec 1444 tx/sec
stdb_module 💿 location multi_index 1000 100 1134.4±18.11µs 845.5±73.36µs 881 tx/sec 1182 tx/sec
stdb_module 💿 location non_unique 0 100 431.8±59.10µs 426.5±25.59µs 2.3 Ktx/sec 2.3 Ktx/sec
stdb_module 💿 location non_unique 1000 100 675.3±18.67µs 834.9±1740.48µs 1480 tx/sec 1197 tx/sec
stdb_module 💿 location unique 0 100 686.3±4.43µs 608.5±37.16µs 1457 tx/sec 1643 tx/sec
stdb_module 💿 location unique 1000 100 664.7±102.17µs 725.7±106.26µs 1504 tx/sec 1378 tx/sec
stdb_module 💿 person multi_index 0 100 1071.9±24.17µs 978.8±57.74µs 932 tx/sec 1021 tx/sec
stdb_module 💿 person multi_index 1000 100 1191.7±11.59µs 1133.8±48.22µs 839 tx/sec 881 tx/sec
stdb_module 💿 person non_unique 0 100 696.0±471.78µs 545.4±119.78µs 1436 tx/sec 1833 tx/sec
stdb_module 💿 person non_unique 1000 100 785.4±4.34µs 981.6±72.14µs 1273 tx/sec 1018 tx/sec
stdb_module 💿 person unique 0 100 744.8±62.16µs 756.8±13.01µs 1342 tx/sec 1321 tx/sec
stdb_module 💿 person unique 1000 100 822.9±14.62µs 957.1±81.69µs 1215 tx/sec 1044 tx/sec
stdb_module 🧠 location multi_index 0 100 501.9±40.36µs 780.0±8.48µs 1992 tx/sec 1282 tx/sec
stdb_module 🧠 location multi_index 1000 100 870.9±34.69µs 962.0±35.06µs 1148 tx/sec 1039 tx/sec
stdb_module 🧠 location non_unique 0 100 310.7±47.08µs 351.3±40.03µs 3.1 Ktx/sec 2.8 Ktx/sec
stdb_module 🧠 location non_unique 1000 100 451.1±6.79µs 388.4±25.08µs 2.2 Ktx/sec 2.5 Ktx/sec
stdb_module 🧠 location unique 0 100 588.9±7.05µs 494.9±54.54µs 1697 tx/sec 2020 tx/sec
stdb_module 🧠 location unique 1000 100 595.1±107.34µs 542.5±30.60µs 1680 tx/sec 1843 tx/sec
stdb_module 🧠 person multi_index 0 100 800.0±14.41µs 930.1±2.94µs 1250 tx/sec 1075 tx/sec
stdb_module 🧠 person multi_index 1000 100 1083.4±24.42µs 1010.2±42.61µs 923 tx/sec 989 tx/sec
stdb_module 🧠 person non_unique 0 100 291.6±1.05µs 423.5±83.94µs 3.3 Ktx/sec 2.3 Ktx/sec
stdb_module 🧠 person non_unique 1000 100 353.4±5.14µs 458.1±69.02µs 2.8 Ktx/sec 2.1 Ktx/sec
stdb_module 🧠 person unique 0 100 507.5±6.01µs 621.8±7.51µs 1970 tx/sec 1608 tx/sec
stdb_module 🧠 person unique 1000 100 677.7±73.56µs 751.1±37.01µs 1475 tx/sec 1331 tx/sec
stdb_raw 💿 location multi_index 0 100 339.9±2.71µs 342.8±8.67µs 2.9 Ktx/sec 2.8 Ktx/sec
stdb_raw 💿 location multi_index 1000 100 364.9±1.34µs 366.5±1.29µs 2.7 Ktx/sec 2.7 Ktx/sec
stdb_raw 💿 location non_unique 0 100 117.8±0.19µs 118.9±1.23µs 8.3 Ktx/sec 8.2 Ktx/sec
stdb_raw 💿 location non_unique 1000 100 131.1±114.71µs 129.7±84.61µs 7.4 Ktx/sec 7.5 Ktx/sec
stdb_raw 💿 location unique 0 100 242.2±0.39µs 241.9±0.44µs 4.0 Ktx/sec 4.0 Ktx/sec
stdb_raw 💿 location unique 1000 100 261.6±1.48µs 274.6±150.24µs 3.7 Ktx/sec 3.6 Ktx/sec
stdb_raw 💿 person multi_index 0 100 706.0±0.72µs 710.4±3.08µs 1416 tx/sec 1407 tx/sec
stdb_raw 💿 person multi_index 1000 100 785.1±487.08µs 776.7±373.77µs 1273 tx/sec 1287 tx/sec
stdb_raw 💿 person non_unique 0 100 218.2±0.40µs 218.1±0.23µs 4.5 Ktx/sec 4.5 Ktx/sec
stdb_raw 💿 person non_unique 1000 100 237.4±165.84µs 221.0±0.60µs 4.1 Ktx/sec 4.4 Ktx/sec
stdb_raw 💿 person unique 0 100 429.2±0.68µs 429.0±0.38µs 2.3 Ktx/sec 2.3 Ktx/sec
stdb_raw 💿 person unique 1000 100 478.4±306.79µs 445.6±0.75µs 2.0 Ktx/sec 2.2 Ktx/sec
stdb_raw 🧠 location multi_index 0 100 296.4±0.59µs 296.0±2.87µs 3.3 Ktx/sec 3.3 Ktx/sec
stdb_raw 🧠 location multi_index 1000 100 321.4±0.66µs 321.6±0.60µs 3.0 Ktx/sec 3.0 Ktx/sec
stdb_raw 🧠 location non_unique 0 100 74.2±0.24µs 76.5±0.12µs 13.2 Ktx/sec 12.8 Ktx/sec
stdb_raw 🧠 location non_unique 1000 100 75.6±0.28µs 77.8±0.23µs 12.9 Ktx/sec 12.6 Ktx/sec
stdb_raw 🧠 location unique 0 100 197.7±2.27µs 198.0±0.53µs 4.9 Ktx/sec 4.9 Ktx/sec
stdb_raw 🧠 location unique 1000 100 217.2±0.30µs 215.1±0.26µs 4.5 Ktx/sec 4.5 Ktx/sec
stdb_raw 🧠 person multi_index 0 100 616.6±0.64µs 619.6±3.53µs 1621 tx/sec 1613 tx/sec
stdb_raw 🧠 person multi_index 1000 100 647.4±1.27µs 648.7±0.66µs 1544 tx/sec 1541 tx/sec
stdb_raw 🧠 person non_unique 0 100 126.5±0.22µs 128.5±0.12µs 7.7 Ktx/sec 7.6 Ktx/sec
stdb_raw 🧠 person non_unique 1000 100 129.2±0.35µs 130.5±0.24µs 7.6 Ktx/sec 7.5 Ktx/sec
stdb_raw 🧠 person unique 0 100 335.6±0.39µs 338.1±0.32µs 2.9 Ktx/sec 2.9 Ktx/sec
stdb_raw 🧠 person unique 1000 100 356.3±0.70µs 355.6±0.62µs 2.7 Ktx/sec 2.7 Ktx/sec

Full table iterate

db on disk schema index type new latency old latency new throughput old throughput
sqlite 💿 location unique 9.4±0.10µs 9.0±0.06µs 104.1 Ktx/sec 108.3 Ktx/sec
sqlite 💿 person unique 9.8±0.09µs 9.6±0.09µs 99.6 Ktx/sec 101.8 Ktx/sec
sqlite 🧠 location unique 8.1±0.08µs 7.8±0.06µs 121.3 Ktx/sec 125.5 Ktx/sec
sqlite 🧠 person unique 8.4±0.07µs 8.3±0.08µs 116.2 Ktx/sec 117.9 Ktx/sec
stdb_module 💿 location unique 46.5±5.12µs 48.4±5.14µs 21.0 Ktx/sec 20.2 Ktx/sec
stdb_module 💿 person unique 55.2±9.88µs 57.8±10.12µs 17.7 Ktx/sec 16.9 Ktx/sec
stdb_module 🧠 location unique 49.9±3.43µs 47.7±4.74µs 19.6 Ktx/sec 20.5 Ktx/sec
stdb_module 🧠 person unique 63.1±6.79µs 62.0±5.95µs 15.5 Ktx/sec 15.7 Ktx/sec
stdb_raw 💿 location unique 9.0±0.09µs 9.0±0.01µs 108.0 Ktx/sec 108.5 Ktx/sec
stdb_raw 💿 person unique 9.2±0.24µs 9.0±0.02µs 106.6 Ktx/sec 108.5 Ktx/sec
stdb_raw 🧠 location unique 9.0±0.20µs 9.0±0.02µs 108.3 Ktx/sec 109.1 Ktx/sec
stdb_raw 🧠 person unique 9.6±0.37µs 8.9±0.02µs 102.2 Ktx/sec 109.2 Ktx/sec

Find unique key

db on disk key type load new latency old latency new throughput old throughput
sqlite 💿 u32 1000 2.4±0.00µs 2.3±0.01µs 403.8 Ktx/sec 417.0 Ktx/sec
sqlite 🧠 u32 1000 1130.5±3.53ns 1132.6±9.66ns 863.8 Ktx/sec 862.3 Ktx/sec
stdb_module 💿 u32 1000 25.8±2.62µs 23.9±1.69µs 37.8 Ktx/sec 40.8 Ktx/sec
stdb_module 🧠 u32 1000 23.5±1.65µs 26.6±2.21µs 41.5 Ktx/sec 36.7 Ktx/sec
stdb_raw 💿 u32 1000 1959.7±16.64ns 1955.7±7.04ns 498.3 Ktx/sec 499.3 Ktx/sec
stdb_raw 🧠 u32 1000 1908.0±3.76ns 1885.3±4.38ns 511.8 Ktx/sec 518.0 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.8±0.02µs 5.6±0.02µs 168.1 Ktx/sec 174.0 Ktx/sec
sqlite 💿 string non_indexed 1000 10 52.9±0.39µs 54.0±0.23µs 18.5 Ktx/sec 18.1 Ktx/sec
sqlite 💿 u64 indexed 1000 10 5.6±0.02µs 5.5±0.02µs 174.2 Ktx/sec 178.8 Ktx/sec
sqlite 💿 u64 non_indexed 1000 10 32.9±0.05µs 33.9±0.26µs 29.7 Ktx/sec 28.8 Ktx/sec
sqlite 🧠 string indexed 1000 10 4.3±0.02µs 4.2±0.02µs 226.2 Ktx/sec 231.7 Ktx/sec
sqlite 🧠 string non_indexed 1000 10 50.6±0.37µs 52.6±0.27µs 19.3 Ktx/sec 18.6 Ktx/sec
sqlite 🧠 u64 indexed 1000 10 4.1±0.01µs 4.0±0.03µs 237.5 Ktx/sec 244.3 Ktx/sec
sqlite 🧠 u64 non_indexed 1000 10 31.4±0.07µs 32.6±0.20µs 31.1 Ktx/sec 29.9 Ktx/sec
stdb_module 💿 string indexed 1000 10 34.4±3.02µs 35.0±2.30µs 28.4 Ktx/sec 27.9 Ktx/sec
stdb_module 💿 string non_indexed 1000 10 166.9±1.73µs 168.3±1.17µs 5.9 Ktx/sec 5.8 Ktx/sec
stdb_module 💿 u64 indexed 1000 10 33.6±2.20µs 31.8±3.31µs 29.1 Ktx/sec 30.7 Ktx/sec
stdb_module 💿 u64 non_indexed 1000 10 142.1±7.25µs 150.4±7.48µs 6.9 Ktx/sec 6.5 Ktx/sec
stdb_module 🧠 string indexed 1000 10 34.4±2.86µs 34.7±2.26µs 28.4 Ktx/sec 28.1 Ktx/sec
stdb_module 🧠 string non_indexed 1000 10 162.7±4.39µs 170.3±4.30µs 6.0 Ktx/sec 5.7 Ktx/sec
stdb_module 🧠 u64 indexed 1000 10 31.3±3.33µs 32.2±2.78µs 31.2 Ktx/sec 30.3 Ktx/sec
stdb_module 🧠 u64 non_indexed 1000 10 134.9±0.97µs 143.0±1.20µs 7.2 Ktx/sec 6.8 Ktx/sec
stdb_raw 💿 string indexed 1000 10 4.4±0.01µs 4.4±0.01µs 220.2 Ktx/sec 223.1 Ktx/sec
stdb_raw 💿 string non_indexed 1000 10 134.8±0.25µs 154.7±0.43µs 7.2 Ktx/sec 6.3 Ktx/sec
stdb_raw 💿 u64 indexed 1000 10 4.4±0.01µs 4.2±0.02µs 223.3 Ktx/sec 231.7 Ktx/sec
stdb_raw 💿 u64 non_indexed 1000 10 115.0±0.28µs 130.9±0.21µs 8.5 Ktx/sec 7.5 Ktx/sec
stdb_raw 🧠 string indexed 1000 10 4.4±0.01µs 4.3±0.01µs 224.1 Ktx/sec 227.2 Ktx/sec
stdb_raw 🧠 string non_indexed 1000 10 130.0±0.23µs 153.3±0.41µs 7.5 Ktx/sec 6.4 Ktx/sec
stdb_raw 🧠 u64 indexed 1000 10 4.3±0.01µs 4.1±0.01µs 227.0 Ktx/sec 237.0 Ktx/sec
stdb_raw 🧠 u64 non_indexed 1000 10 114.4±0.56µs 131.1±0.34µs 8.5 Ktx/sec 7.4 Ktx/sec

Serialize

schema format count new latency old latency new throughput old throughput
location bsatn 100 1908.2±26.51ns 1595.9±4.02ns 50.0 Mtx/sec 59.8 Mtx/sec
location json 100 3.5±0.04µs 3.3±0.04µs 27.3 Mtx/sec 29.1 Mtx/sec
location product_value 100 606.3±0.92ns 552.2±0.84ns 157.3 Mtx/sec 172.7 Mtx/sec
person bsatn 100 2.8±0.01µs 2.4±0.05µs 34.3 Mtx/sec 40.0 Mtx/sec
person json 100 4.9±0.04µs 5.4±0.03µs 19.6 Mtx/sec 17.7 Mtx/sec
person product_value 100 1005.2±1.12ns 1029.4±0.89ns 94.9 Mtx/sec 92.6 Mtx/sec

Module: invoke with large arguments

arg size new latency old latency new throughput old throughput
64KiB 62.7±5.32µs 67.2±7.54µs - -

Module: print bulk

line count new latency old latency new throughput old throughput
1 23.5±1.76µs 21.9±0.97µs - -
100 190.1±1.30µs 188.9±4.26µs - -
1000 1735.0±10.23µs 1776.5±98.21µs - -

Remaining benchmarks

name new latency old latency new throughput old throughput

Please sign in to comment.