Skip to content

Commit

Permalink
Update/upgrade dependencies (#266)
Browse files Browse the repository at this point in the history
* Update and dedup some deps

* Upgrade dependencies
  • Loading branch information
coolreader18 authored Oct 25, 2023
1 parent 60b77ae commit bc54b73
Show file tree
Hide file tree
Showing 33 changed files with 1,219 additions and 1,048 deletions.
1,805 changes: 914 additions & 891 deletions Cargo.lock

Large diffs are not rendered by default.

40 changes: 16 additions & 24 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,13 @@ bitflags = "2.3.3"
byte-unit = "4.0.18"
bytes = "1.2.1"
bytestring = { version = "1.2.0", features = ["serde"] }
cargo_metadata = "0.15.2"
cargo_metadata = "0.17.0"
chrono = { version = "0.4.24", default-features = false }
clap = { version = "4.2.4", features = ["derive"] }
colored = "2.0.0"
console = { version = "0.15.6" }
convert_case = "0.6.0"
criterion = { version = "0.4.0", features = [
"async",
"async_tokio",
"html_reports",
] }
criterion = { version = "0.5.1", features = ["async", "async_tokio", "html_reports"] }
crossbeam-channel = "0.5"
cursive = { version = "0.20", default-features = false, features = ["crossterm-backend"] }
decorum = { version = "0.3.1", default-features = false, features = ["std"] }
Expand All @@ -109,10 +105,10 @@ humantime = "2.1.0"
hyper = "0.14.18"
im = "15.1"
imara-diff = "0.1.3"
indexmap = "1.9.2"
indexmap = "2.0.0"
insta = { version = "1.21.0", features = ["toml"] }
is-terminal = "0.4"
itertools = "0.10.5"
itertools = "0.11.0"
jsonwebtoken = { version = "8.1.0" }
lazy_static = "1.4.0"
log = "0.4.17"
Expand Down Expand Up @@ -141,34 +137,31 @@ 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"
sendgrid = { version = "0.18.1", features = ["async"] }
sendgrid = { version = "0.19.2", features = ["async"] }
serde = "1.0.136"
serde_json = { version = "1.0.87", features = ["raw_value"] }
serde_path_to_error = "0.1.9"
serde_with = { version = "2.2.0", features = ["base64", "hex"] }
serde_with = { version = "3.3.0", features = ["base64", "hex"] }
serial_test = "2.0.0"
sha1 = "0.10.1"
sha3 = "0.10.0"
slab = "0.4.7"
sled = "0.34.7"
sqlparser = "0.34.0"
sqllogictest-engines = "0.13.0"
sqllogictest = "0.13.2"
strum = { version = "0.24.1", features = ["derive"] }
sqlparser = "0.38.0"
sqllogictest-engines = "0.17"
sqllogictest = "0.17"
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",
] }
tabled = "0.8.0"
tempdir = "0.3.7"
syntect = { version = "5.0.0", default-features = false, features = ["default-fancy"] }
tabled = "0.14.0"
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.19", features = ["native-tls"] }
toml = "0.5"
tokio-tungstenite = { version = "0.20", features = ["native-tls"] }
toml = "0.8"
tower-http = { version = "0.4.1", features = ["cors"] }
tracing = { version = "0.1.37", features = ["release_max_level_off"] }
tracing-appender = "0.2.2"
Expand All @@ -188,8 +181,7 @@ wasmer-middlewares = "4.1.1"
wasmer-types = "4.1.1"
wasmer-vm = "4.1.1"

wasmparser = "0.92.0"
wasmtime = { version = "7", default-features = false, features = ["cranelift"] }
wasmtime = { version = "14", default-features = false, features = ["cranelift"] }

# We use the "ondemand" feature to allow connecting after the start,
# and reconnecting, from the tracy client to the database.
Expand All @@ -210,4 +202,4 @@ openssl = { version = "0.10", features = ["vendored"] }

# Rocksdb ostorage backend, linked only if "rocksdb" feature enabled.
# if we link bzip, we get multiple defs
rocksdb = { version = "0.19.0", default-features = false, features = ["lz4"] }
rocksdb = { version = "0.21.0", default-features = false, features = ["lz4"] }
2 changes: 1 addition & 1 deletion crates/bench/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ log.workspace = true
clap.workspace = true
rusqlite.workspace = true
criterion.workspace = true
tempdir.workspace = true
tempfile.workspace = true
rand.workspace = true
tokio.workspace = true
serde_json.workspace = true
Expand Down
4 changes: 2 additions & 2 deletions crates/bench/src/spacetime_raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use spacetimedb::db::relational_db::{open_db, RelationalDB};
use spacetimedb_lib::sats::AlgebraicValue;
use spacetimedb_primitives::{ColId, TableId};
use std::hint::black_box;
use tempdir::TempDir;
use tempfile::TempDir;

pub type DbResult = (RelationalDB, TempDir, u32);

Expand All @@ -27,7 +27,7 @@ impl BenchDatabase for SpacetimeRaw {
where
Self: Sized,
{
let temp_dir = TempDir::new("stdb_test")?;
let temp_dir = TempDir::with_prefix("stdb_test")?;
let db = open_db(temp_dir.path(), in_memory, fsync)?;

Ok(SpacetimeRaw {
Expand Down
4 changes: 2 additions & 2 deletions crates/bench/src/sqlite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use std::{
hint::black_box,
sync::{Arc, RwLock},
};
use tempdir::TempDir;
use tempfile::TempDir;

/// SQLite benchmark harness.
pub struct SQLite {
Expand All @@ -30,7 +30,7 @@ impl BenchDatabase for SQLite {
where
Self: Sized,
{
let temp_dir = TempDir::new("sqlite_test")?;
let temp_dir = TempDir::with_prefix("sqlite_test")?;
let db = if in_memory {
Connection::open_in_memory()?
} else {
Expand Down
8 changes: 6 additions & 2 deletions crates/cli/src/subcommands/identity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ use reqwest::{StatusCode, Url};
use serde::Deserialize;
use spacetimedb::auth::identity::decode_token;
use spacetimedb_lib::{recovery::RecoveryCodeResponse, Identity};
use tabled::{object::Columns, Alignment, Modify, Style, Table, Tabled};
use tabled::{
settings::{object::Columns, Alignment, Modify, Style},
Table, Tabled,
};

pub fn cli() -> Command {
Command::new("identity")
Expand Down Expand Up @@ -518,7 +521,8 @@ Fetch the server's fingerprint with:
println!("Identities for {}:", config.server_nick_or_host(server)?);
}

let table = Table::new(&rows)
let mut table = Table::new(&rows);
table
.with(Style::empty())
.with(Modify::new(Columns::first()).with(Alignment::right()));
println!("{}", table);
Expand Down
9 changes: 6 additions & 3 deletions crates/cli/src/subcommands/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ use clap::{Arg, ArgMatches, Command};
use reqwest::StatusCode;
use serde::Deserialize;
use spacetimedb_lib::Address;
use tabled::object::Columns;
use tabled::{Alignment, Modify, Style, Table, Tabled};
use tabled::{
settings::{object::Columns, Alignment, Modify, Style},
Table, Tabled,
};

pub fn cli() -> Command {
Command::new("list")
Expand Down Expand Up @@ -67,7 +69,8 @@ pub async fn exec(config: Config, args: &ArgMatches) -> Result<(), anyhow::Error

let identity = identity_config.nick_or_identity();
if !result.addresses.is_empty() {
let table = Table::new(result.addresses)
let mut table = Table::new(result.addresses);
table
.with(Style::psql())
.with(Modify::new(Columns::first()).with(Alignment::left()));
println!("Associated database addresses for {}:\n", identity);
Expand Down
8 changes: 6 additions & 2 deletions crates/cli/src/subcommands/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ use crate::{
};
use anyhow::Context;
use clap::{Arg, ArgAction, ArgMatches, Command};
use tabled::{object::Columns, Alignment, Modify, Style, Table, Tabled};
use tabled::{
settings::{object::Columns, Alignment, Modify, Style},
Table, Tabled,
};

pub fn cli() -> Command {
Command::new("server")
Expand Down Expand Up @@ -170,7 +173,8 @@ pub async fn exec_list(config: Config, _args: &ArgMatches) -> Result<(), anyhow:
});
}

let table = Table::new(&rows)
let mut table = Table::new(&rows);
table
.with(Style::empty())
.with(Modify::new(Columns::first()).with(Alignment::right()));
println!("{}", table);
Expand Down
93 changes: 49 additions & 44 deletions crates/cli/src/subcommands/sql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ use std::time::Instant;

use crate::api::{from_json_seed, ClientApi, Connection, StmtResultJson};
use clap::{Arg, ArgAction, ArgGroup, ArgMatches};
use itertools::Itertools;
use reqwest::RequestBuilder;
use spacetimedb_lib::de::serde::SeedWrapper;
use spacetimedb_lib::sats::{satn, Typespace};
use tabled::builder::Builder;
use tabled::Style;
use tabled::settings::Style;

use crate::config::Config;
use crate::util::{database_address, get_auth_header_only};
Expand Down Expand Up @@ -76,17 +76,13 @@ pub(crate) async fn parse_req(mut config: Config, args: &ArgMatches) -> Result<C
}

// Need to report back timings from each query from the backend instead of infer here...
fn print_row_count(rows: usize, with_stats: bool) {
if with_stats {
let txt = if rows == 1 { "row" } else { "rows" };
println!("({rows} {txt})");
}
fn print_row_count(rows: usize) -> String {
let txt = if rows == 1 { "row" } else { "rows" };
format!("({rows} {txt})")
}

fn print_timings(now: Instant, with_stats: bool) {
if with_stats {
println!("Time: {:.2?}", now.elapsed());
}
fn print_timings(now: Instant) {
println!("Time: {:.2?}", now.elapsed());
}

pub(crate) async fn run_sql(builder: RequestBuilder, sql: &str, with_stats: bool) -> Result<(), anyhow::Error> {
Expand All @@ -104,47 +100,56 @@ pub(crate) async fn run_sql(builder: RequestBuilder, sql: &str, with_stats: bool

// Print only `OK for empty tables as it's likely a command like `INSERT`.
if stmt_result_json.is_empty() {
print_timings(now, with_stats);
if with_stats {
print_timings(now);
}
println!("OK");
return Ok(());
};

for (i, stmt_result) in stmt_result_json.iter().enumerate() {
let StmtResultJson { schema, rows } = &stmt_result;

let mut builder = Builder::default();
builder.set_columns(
schema
.elements
.iter()
.enumerate()
.map(|(i, e)| e.name.clone().unwrap_or_else(|| format!("column {i}"))),
);

let typespace = Typespace::default();
let ty = typespace.with_type(schema);
for row in rows {
let row = from_json_seed(row.get(), SeedWrapper(ty))?;
builder.add_record(
row.elements
.iter()
.zip(&schema.elements)
.map(|(v, e)| satn::PsqlWrapper(ty.with(&e.algebraic_type).with_value(v))),
);
}
stmt_result_json
.iter()
.map(|stmt_result| {
let mut table = stmt_result_to_table(stmt_result)?;
if with_stats {
let row_count = print_row_count(table.count_rows());
table.with(tabled::settings::panel::Footer::new(row_count));
}
anyhow::Ok(table)
})
.process_results(|it| println!("{}", it.format("\n\n")))?;
if with_stats {
print_timings(now);
}

let table = builder.build().with(Style::psql());
Ok(())
}

if i > 0 {
println!("\n{}", table);
} else {
println!("{}", table);
}
print_row_count(rows.len(), with_stats);
fn stmt_result_to_table(stmt_result: &StmtResultJson) -> anyhow::Result<tabled::Table> {
let StmtResultJson { schema, rows } = stmt_result;

let mut builder = tabled::builder::Builder::default();
builder.set_header(
schema
.elements
.iter()
.enumerate()
.map(|(i, e)| e.name.clone().unwrap_or_else(|| format!("column {i}"))),
);

let ty = Typespace::EMPTY.with_type(schema);
for row in rows {
let row = from_json_seed(row.get(), SeedWrapper(ty))?;
builder.push_record(
ty.with_values(&row)
.map(|col_val| satn::PsqlWrapper(col_val).to_string()),
);
}
print_timings(now, with_stats);

Ok(())
let mut table = builder.build();
table.with(Style::psql());

Ok(table)
}

pub async fn exec(config: Config, args: &ArgMatches) -> Result<(), anyhow::Error> {
Expand Down
6 changes: 3 additions & 3 deletions crates/client-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ anyhow = { version = "1.0.57", features = ["backtrace"] }
regex = "1"
prometheus = "0.13.0"
email_address = "0.2.3"
tempdir = "0.3.7"
tempfile.workspace = true
async-trait = "0.1.60"
chrono = { version = "0.4.23", features = ["serde"]}
rand = "0.8.5"
axum = { version = "0.6.16", features = ["headers", "ws", "tracing"] }
axum = { version = "0.6.16", features = ["headers", "tracing"] }
hyper = "0.14"
http = "0.2"
mime = "0.3.17"
tokio-stream = { version = "0.1.12", features = ["sync"] }
futures = "0.3"
bytes = "1"
bytestring = "1"
tokio-tungstenite = "0.18.0"
tokio-tungstenite.workspace = true
itoa = "1.0.9"
derive_more = "0.99.17"
2 changes: 1 addition & 1 deletion crates/client-api/src/routes/subscribe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ where
};

let ws_config = WebSocketConfig {
max_send_queue: None,
max_message_size: Some(0x2000000),
max_frame_size: None,
accept_unmasked_frames: false,
..Default::default()
};

tokio::spawn(async move {
Expand Down
4 changes: 2 additions & 2 deletions crates/client-api/src/routes/tracelog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use axum::extract::{Path, State};
use axum::response::IntoResponse;
use http::StatusCode;
use serde::Deserialize;
use tempdir::TempDir;
use tempfile::TempDir;

use spacetimedb::address::Address;
use spacetimedb::database_instance_context::DatabaseInstanceContext;
Expand Down Expand Up @@ -69,7 +69,7 @@ pub async fn stop_tracelog<S: ControlStateReadAccess + NodeDelegate>(
pub async fn perform_tracelog_replay(body: Bytes) -> axum::response::Result<impl IntoResponse> {
// Build out a temporary database
let storage = Storage::Disk;
let tmp_dir = TempDir::new("stdb_test").expect("establish tmpdir");
let tmp_dir = TempDir::with_prefix("stdb_test").expect("establish tmpdir");
let db_path = tmp_dir.path();
let logger_path = tmp_dir.path();
let identity = Identity::from_byte_array(hash_bytes(b"This is a fake identity.").data);
Expand Down
Loading

1 comment on commit bc54b73

@github-actions
Copy link

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 💿 467.0±4.38ns 440.6±2.18ns - -
sqlite 🧠 448.5±2.32ns 433.6±1.07ns - -
stdb_module 💿 16.1±0.50µs 15.8±0.42µs - -
stdb_module 🧠 16.4±0.66µs 16.4±0.58µs - -
stdb_raw 💿 189.8±2.81ns 102.0±0.86ns - -
stdb_raw 🧠 190.1±2.84ns 101.7±0.78ns - -

Single-row insertions

db on disk schema index type load new latency old latency new throughput old throughput
sqlite 💿 location multi_index 0 14.7±0.61µs 14.6±0.04µs 66.4 Ktx/sec 66.9 Ktx/sec
sqlite 💿 location multi_index 1000 18.0±21.10µs 15.9±0.12µs 54.4 Ktx/sec 61.3 Ktx/sec
sqlite 💿 location non_unique 0 7.3±1.05µs 7.3±0.05µs 133.1 Ktx/sec 134.0 Ktx/sec
sqlite 💿 location non_unique 1000 7.0±0.03µs 7.0±0.03µs 138.6 Ktx/sec 138.5 Ktx/sec
sqlite 💿 location unique 0 7.2±0.04µs 7.3±0.27µs 136.1 Ktx/sec 134.0 Ktx/sec
sqlite 💿 location unique 1000 7.1±0.03µs 7.1±0.10µs 137.6 Ktx/sec 136.6 Ktx/sec
sqlite 💿 person multi_index 0 14.3±0.05µs 14.4±0.06µs 68.4 Ktx/sec 67.7 Ktx/sec
sqlite 💿 person multi_index 1000 16.2±0.11µs 16.1±0.19µs 60.1 Ktx/sec 60.5 Ktx/sec
sqlite 💿 person non_unique 0 7.3±0.04µs 7.4±0.04µs 134.5 Ktx/sec 131.4 Ktx/sec
sqlite 💿 person non_unique 1000 7.3±0.03µs 7.3±0.04µs 133.9 Ktx/sec 134.5 Ktx/sec
sqlite 💿 person unique 0 7.4±0.80µs 7.5±0.38µs 132.9 Ktx/sec 130.6 Ktx/sec
sqlite 💿 person unique 1000 7.3±0.07µs 7.4±0.04µs 133.4 Ktx/sec 132.2 Ktx/sec
sqlite 🧠 location multi_index 0 4.0±0.01µs 4.1±0.01µs 243.0 Ktx/sec 237.0 Ktx/sec
sqlite 🧠 location multi_index 1000 5.3±0.05µs 5.3±0.03µs 184.2 Ktx/sec 185.7 Ktx/sec
sqlite 🧠 location non_unique 0 1862.0±5.56ns 1876.0±6.14ns 524.5 Ktx/sec 520.6 Ktx/sec
sqlite 🧠 location non_unique 1000 1923.1±10.83ns 1931.3±12.26ns 507.8 Ktx/sec 505.6 Ktx/sec
sqlite 🧠 location unique 0 1857.2±10.34ns 1850.0±6.98ns 525.8 Ktx/sec 527.9 Ktx/sec
sqlite 🧠 location unique 1000 1975.6±17.45ns 1958.9±6.41ns 494.3 Ktx/sec 498.5 Ktx/sec
sqlite 🧠 person multi_index 0 3.7±0.01µs 3.7±0.01µs 265.2 Ktx/sec 261.8 Ktx/sec
sqlite 🧠 person multi_index 1000 5.5±0.03µs 5.5±0.02µs 177.8 Ktx/sec 178.0 Ktx/sec
sqlite 🧠 person non_unique 0 1920.5±4.10ns 1957.7±6.77ns 508.5 Ktx/sec 498.8 Ktx/sec
sqlite 🧠 person non_unique 1000 2.0±0.02µs 2.0±0.02µs 480.0 Ktx/sec 480.6 Ktx/sec
sqlite 🧠 person unique 0 1904.6±8.19ns 1949.8±6.81ns 512.7 Ktx/sec 500.8 Ktx/sec
sqlite 🧠 person unique 1000 2.0±0.01µs 2.1±0.01µs 477.4 Ktx/sec 473.3 Ktx/sec
stdb_module 💿 location multi_index 0 41.3±5.21µs 36.6±3.35µs 23.6 Ktx/sec 26.7 Ktx/sec
stdb_module 💿 location multi_index 1000 126.1±23.85µs 263.4±2.80µs 7.7 Ktx/sec 3.7 Ktx/sec
stdb_module 💿 location non_unique 0 35.5±3.89µs 32.8±3.10µs 27.5 Ktx/sec 29.8 Ktx/sec
stdb_module 💿 location non_unique 1000 293.5±3.53µs 181.4±77.71µs 3.3 Ktx/sec 5.4 Ktx/sec
stdb_module 💿 location unique 0 40.8±3.95µs 34.7±3.60µs 24.0 Ktx/sec 28.1 Ktx/sec
stdb_module 💿 location unique 1000 108.5±6.68µs 122.7±16.93µs 9.0 Ktx/sec 8.0 Ktx/sec
stdb_module 💿 person multi_index 0 50.9±5.40µs 46.9±4.65µs 19.2 Ktx/sec 20.8 Ktx/sec
stdb_module 💿 person multi_index 1000 211.7±104.85µs 283.9±4.67µs 4.6 Ktx/sec 3.4 Ktx/sec
stdb_module 💿 person non_unique 0 35.6±3.57µs 32.4±2.43µs 27.4 Ktx/sec 30.2 Ktx/sec
stdb_module 💿 person non_unique 1000 186.8±10.51µs 172.9±18.03µs 5.2 Ktx/sec 5.6 Ktx/sec
stdb_module 💿 person unique 0 50.6±5.07µs 39.2±3.01µs 19.3 Ktx/sec 24.9 Ktx/sec
stdb_module 💿 person unique 1000 147.6±10.38µs 248.2±4.13µs 6.6 Ktx/sec 3.9 Ktx/sec
stdb_module 🧠 location multi_index 0 32.9±1.87µs 30.9±3.14µs 29.7 Ktx/sec 31.6 Ktx/sec
stdb_module 🧠 location multi_index 1000 250.3±11.24µs 159.8±86.50µs 3.9 Ktx/sec 6.1 Ktx/sec
stdb_module 🧠 location non_unique 0 28.6±2.00µs 26.1±1.61µs 34.2 Ktx/sec 37.4 Ktx/sec
stdb_module 🧠 location non_unique 1000 274.5±4.62µs 204.3±36.40µs 3.6 Ktx/sec 4.8 Ktx/sec
stdb_module 🧠 location unique 0 31.8±2.90µs 31.0±2.70µs 30.7 Ktx/sec 31.5 Ktx/sec
stdb_module 🧠 location unique 1000 230.2±4.07µs 95.2±7.14µs 4.2 Ktx/sec 10.3 Ktx/sec
stdb_module 🧠 person multi_index 0 41.6±4.87µs 32.9±2.43µs 23.5 Ktx/sec 29.7 Ktx/sec
stdb_module 🧠 person multi_index 1000 316.1±3.85µs 265.4±5.62µs 3.1 Ktx/sec 3.7 Ktx/sec
stdb_module 🧠 person non_unique 0 31.0±3.08µs 27.2±1.68µs 31.5 Ktx/sec 36.0 Ktx/sec
stdb_module 🧠 person non_unique 1000 143.7±6.37µs 166.2±19.84µs 6.8 Ktx/sec 5.9 Ktx/sec
stdb_module 🧠 person unique 0 34.2±3.42µs 30.2±1.90µs 28.5 Ktx/sec 32.3 Ktx/sec
stdb_module 🧠 person unique 1000 192.6±5.89µs 101.0±4.48µs 5.1 Ktx/sec 9.7 Ktx/sec
stdb_raw 💿 location multi_index 0 6.3±0.02µs 5.0±0.05µs 155.4 Ktx/sec 196.5 Ktx/sec
stdb_raw 💿 location multi_index 1000 8.7±0.17µs 7.1±0.15µs 112.0 Ktx/sec 136.9 Ktx/sec
stdb_raw 💿 location non_unique 0 4.0±0.06µs 3.4±0.01µs 247.2 Ktx/sec 285.3 Ktx/sec
stdb_raw 💿 location non_unique 1000 5.2±0.14µs 4.6±0.15µs 188.8 Ktx/sec 213.6 Ktx/sec
stdb_raw 💿 location unique 0 5.3±0.19µs 4.2±0.01µs 185.5 Ktx/sec 234.9 Ktx/sec
stdb_raw 💿 location unique 1000 23.3±159.73µs 15.0±88.68µs 41.9 Ktx/sec 65.1 Ktx/sec
stdb_raw 💿 person multi_index 0 9.9±0.01µs 8.5±0.18µs 98.7 Ktx/sec 114.8 Ktx/sec
stdb_raw 💿 person multi_index 1000 12.9±0.32µs 40.0±287.79µs 75.5 Ktx/sec 24.4 Ktx/sec
stdb_raw 💿 person non_unique 0 4.9±0.31µs 4.0±0.01µs 198.0 Ktx/sec 246.5 Ktx/sec
stdb_raw 💿 person non_unique 1000 28.4±157.31µs 17.7±124.03µs 34.4 Ktx/sec 55.0 Ktx/sec
stdb_raw 💿 person unique 0 6.9±0.03µs 5.7±0.17µs 142.4 Ktx/sec 171.9 Ktx/sec
stdb_raw 💿 person unique 1000 30.5±213.00µs 23.0±153.62µs 32.0 Ktx/sec 42.4 Ktx/sec
stdb_raw 🧠 location multi_index 0 4.8±0.01µs 3.6±0.01µs 203.5 Ktx/sec 270.9 Ktx/sec
stdb_raw 🧠 location multi_index 1000 6.4±0.07µs 5.0±0.06µs 153.4 Ktx/sec 193.5 Ktx/sec
stdb_raw 🧠 location non_unique 0 2.5±0.02µs 2.1±0.01µs 387.6 Ktx/sec 457.8 Ktx/sec
stdb_raw 🧠 location non_unique 1000 3.2±0.03µs 2.7±0.02µs 305.4 Ktx/sec 359.7 Ktx/sec
stdb_raw 🧠 location unique 0 3.8±0.01µs 2.8±0.01µs 258.7 Ktx/sec 349.6 Ktx/sec
stdb_raw 🧠 location unique 1000 5.1±0.07µs 4.0±0.03µs 190.2 Ktx/sec 242.8 Ktx/sec
stdb_raw 🧠 person multi_index 0 8.4±0.03µs 6.9±0.01µs 116.0 Ktx/sec 140.5 Ktx/sec
stdb_raw 🧠 person multi_index 1000 10.4±0.10µs 8.9±0.11µs 93.9 Ktx/sec 110.0 Ktx/sec
stdb_raw 🧠 person non_unique 0 3.1±0.01µs 2.6±0.00µs 317.5 Ktx/sec 369.7 Ktx/sec
stdb_raw 🧠 person non_unique 1000 3.8±0.02µs 3.2±0.02µs 259.5 Ktx/sec 301.1 Ktx/sec
stdb_raw 🧠 person unique 0 5.4±0.01µs 4.3±0.01µs 182.4 Ktx/sec 226.3 Ktx/sec
stdb_raw 🧠 person unique 1000 6.8±0.07µs 5.5±0.02µs 143.5 Ktx/sec 177.6 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.5±2.23µs 132.3±0.42µs 7.4 Ktx/sec 7.4 Ktx/sec
sqlite 💿 location multi_index 1000 100 204.2±1.25µs 205.9±1.10µs 4.8 Ktx/sec 4.7 Ktx/sec
sqlite 💿 location non_unique 0 100 51.3±1.06µs 51.9±1.54µs 19.0 Ktx/sec 18.8 Ktx/sec
sqlite 💿 location non_unique 1000 100 53.6±0.29µs 55.1±0.48µs 18.2 Ktx/sec 17.7 Ktx/sec
sqlite 💿 location unique 0 100 53.6±2.61µs 53.6±1.15µs 18.2 Ktx/sec 18.2 Ktx/sec
sqlite 💿 location unique 1000 100 58.1±0.64µs 58.3±0.22µs 16.8 Ktx/sec 16.7 Ktx/sec
sqlite 💿 person multi_index 0 100 119.5±2.66µs 119.6±5.59µs 8.2 Ktx/sec 8.2 Ktx/sec
sqlite 💿 person multi_index 1000 100 233.1±0.71µs 230.2±1.28µs 4.2 Ktx/sec 4.2 Ktx/sec
sqlite 💿 person non_unique 0 100 49.7±1.60µs 48.7±1.71µs 19.6 Ktx/sec 20.1 Ktx/sec
sqlite 💿 person non_unique 1000 100 61.5±0.21µs 61.7±13.63µs 15.9 Ktx/sec 15.8 Ktx/sec
sqlite 💿 person unique 0 100 50.8±1.25µs 50.1±1.31µs 19.2 Ktx/sec 19.5 Ktx/sec
sqlite 💿 person unique 1000 100 57.4±10.98µs 56.0±0.24µs 17.0 Ktx/sec 17.4 Ktx/sec
sqlite 🧠 location multi_index 0 100 120.9±0.46µs 120.7±0.61µs 8.1 Ktx/sec 8.1 Ktx/sec
sqlite 🧠 location multi_index 1000 100 172.3±0.46µs 171.7±0.20µs 5.7 Ktx/sec 5.7 Ktx/sec
sqlite 🧠 location non_unique 0 100 45.6±0.47µs 44.4±0.25µs 21.4 Ktx/sec 22.0 Ktx/sec
sqlite 🧠 location non_unique 1000 100 46.4±0.29µs 47.1±0.51µs 21.0 Ktx/sec 20.7 Ktx/sec
sqlite 🧠 location unique 0 100 46.8±0.37µs 46.5±0.40µs 20.9 Ktx/sec 21.0 Ktx/sec
sqlite 🧠 location unique 1000 100 50.6±0.50µs 50.1±0.38µs 19.3 Ktx/sec 19.5 Ktx/sec
sqlite 🧠 person multi_index 0 100 109.2±0.42µs 108.1±0.33µs 8.9 Ktx/sec 9.0 Ktx/sec
sqlite 🧠 person multi_index 1000 100 190.7±0.53µs 191.4±0.46µs 5.1 Ktx/sec 5.1 Ktx/sec
sqlite 🧠 person non_unique 0 100 43.9±0.44µs 41.9±0.56µs 22.2 Ktx/sec 23.3 Ktx/sec
sqlite 🧠 person non_unique 1000 100 47.0±0.35µs 46.3±0.24µs 20.8 Ktx/sec 21.1 Ktx/sec
sqlite 🧠 person unique 0 100 45.2±0.54µs 44.5±0.41µs 21.6 Ktx/sec 21.9 Ktx/sec
sqlite 🧠 person unique 1000 100 49.5±0.44µs 47.7±0.29µs 19.7 Ktx/sec 20.5 Ktx/sec
stdb_module 💿 location multi_index 0 100 897.2±43.71µs 611.0±122.68µs 1114 tx/sec 1636 tx/sec
stdb_module 💿 location multi_index 1000 100 1154.8±106.65µs 796.0±3.63µs 865 tx/sec 1256 tx/sec
stdb_module 💿 location non_unique 0 100 532.5±8.33µs 465.7±14.56µs 1878 tx/sec 2.1 Ktx/sec
stdb_module 💿 location non_unique 1000 100 550.2±4.22µs 530.6±41.11µs 1817 tx/sec 1884 tx/sec
stdb_module 💿 location unique 0 100 509.4±38.37µs 441.0±78.15µs 1963 tx/sec 2.2 Ktx/sec
stdb_module 💿 location unique 1000 100 634.8±106.24µs 740.7±89.76µs 1575 tx/sec 1350 tx/sec
stdb_module 💿 person multi_index 0 100 927.1±8.33µs 847.8±135.15µs 1078 tx/sec 1179 tx/sec
stdb_module 💿 person multi_index 1000 100 1096.7±34.06µs 1113.4±21.95µs 911 tx/sec 898 tx/sec
stdb_module 💿 person non_unique 0 100 478.8±15.65µs 524.4±46.71µs 2.0 Ktx/sec 1907 tx/sec
stdb_module 💿 person non_unique 1000 100 648.2±29.07µs 689.3±4.35µs 1542 tx/sec 1450 tx/sec
stdb_module 💿 person unique 0 100 655.9±56.64µs 610.2±1.78µs 1524 tx/sec 1638 tx/sec
stdb_module 💿 person unique 1000 100 930.9±36.81µs 848.2±4.61µs 1074 tx/sec 1179 tx/sec
stdb_module 🧠 location multi_index 0 100 648.9±137.82µs 390.0±55.04µs 1541 tx/sec 2.5 Ktx/sec
stdb_module 🧠 location multi_index 1000 100 686.4±14.14µs 534.9±34.08µs 1456 tx/sec 1869 tx/sec
stdb_module 🧠 location non_unique 0 100 402.8±26.28µs 288.5±26.90µs 2.4 Ktx/sec 3.4 Ktx/sec
stdb_module 🧠 location non_unique 1000 100 610.7±3.52µs 488.0±64.14µs 1637 tx/sec 2.0 Ktx/sec
stdb_module 🧠 location unique 0 100 476.8±2.43µs 461.7±67.91µs 2.0 Ktx/sec 2.1 Ktx/sec
stdb_module 🧠 location unique 1000 100 759.6±54.70µs 531.0±4.54µs 1316 tx/sec 1883 tx/sec
stdb_module 🧠 person multi_index 0 100 956.7±20.22µs 712.6±10.19µs 1045 tx/sec 1403 tx/sec
stdb_module 🧠 person multi_index 1000 100 1043.7±4.47µs 790.6±24.88µs 958 tx/sec 1264 tx/sec
stdb_module 🧠 person non_unique 0 100 386.9±48.66µs 443.3±50.33µs 2.5 Ktx/sec 2.2 Ktx/sec
stdb_module 🧠 person non_unique 1000 100 477.4±4.38µs 571.5±65.94µs 2.0 Ktx/sec 1749 tx/sec
stdb_module 🧠 person unique 0 100 631.8±39.54µs 569.2±8.54µs 1582 tx/sec 1756 tx/sec
stdb_module 🧠 person unique 1000 100 810.1±57.15µs 755.0±9.36µs 1234 tx/sec 1324 tx/sec
stdb_raw 💿 location multi_index 0 100 367.1±0.74µs 267.2±0.47µs 2.7 Ktx/sec 3.7 Ktx/sec
stdb_raw 💿 location multi_index 1000 100 415.7±229.40µs 309.2±177.93µs 2.3 Ktx/sec 3.2 Ktx/sec
stdb_raw 💿 location non_unique 0 100 140.9±0.36µs 122.5±0.64µs 6.9 Ktx/sec 8.0 Ktx/sec
stdb_raw 💿 location non_unique 1000 100 142.9±1.04µs 127.2±25.28µs 6.8 Ktx/sec 7.7 Ktx/sec
stdb_raw 💿 location unique 0 100 268.5±9.46µs 191.2±0.64µs 3.6 Ktx/sec 5.1 Ktx/sec
stdb_raw 💿 location unique 1000 100 303.7±160.11µs 209.1±1.41µs 3.2 Ktx/sec 4.7 Ktx/sec
stdb_raw 💿 person multi_index 0 100 685.1±1.94µs 568.2±3.42µs 1459 tx/sec 1759 tx/sec
stdb_raw 💿 person multi_index 1000 100 717.8±6.07µs 626.2±295.15µs 1393 tx/sec 1597 tx/sec
stdb_raw 💿 person non_unique 0 100 198.8±0.51µs 176.0±0.37µs 4.9 Ktx/sec 5.5 Ktx/sec
stdb_raw 💿 person non_unique 1000 100 211.9±98.76µs 178.8±0.43µs 4.6 Ktx/sec 5.5 Ktx/sec
stdb_raw 💿 person unique 0 100 408.6±0.56µs 324.0±1.64µs 2.4 Ktx/sec 3.0 Ktx/sec
stdb_raw 💿 person unique 1000 100 447.9±181.70µs 341.4±1.72µs 2.2 Ktx/sec 2.9 Ktx/sec
stdb_raw 🧠 location multi_index 0 100 362.7±0.67µs 262.3±0.52µs 2.7 Ktx/sec 3.7 Ktx/sec
stdb_raw 🧠 location multi_index 1000 100 389.6±0.77µs 286.6±0.38µs 2.5 Ktx/sec 3.4 Ktx/sec
stdb_raw 🧠 location non_unique 0 100 136.9±0.14µs 120.2±1.27µs 7.1 Ktx/sec 8.1 Ktx/sec
stdb_raw 🧠 location non_unique 1000 100 139.0±0.73µs 122.4±0.17µs 7.0 Ktx/sec 8.0 Ktx/sec
stdb_raw 🧠 location unique 0 100 266.1±2.08µs 188.4±0.14µs 3.7 Ktx/sec 5.2 Ktx/sec
stdb_raw 🧠 location unique 1000 100 287.2±3.33µs 205.8±1.62µs 3.4 Ktx/sec 4.7 Ktx/sec
stdb_raw 🧠 person multi_index 0 100 679.2±0.58µs 560.7±3.19µs 1472 tx/sec 1783 tx/sec
stdb_raw 🧠 person multi_index 1000 100 712.1±1.25µs 589.3±1.60µs 1404 tx/sec 1696 tx/sec
stdb_raw 🧠 person non_unique 0 100 193.3±0.76µs 171.8±1.92µs 5.1 Ktx/sec 5.7 Ktx/sec
stdb_raw 🧠 person non_unique 1000 100 196.0±0.24µs 174.2±1.26µs 5.0 Ktx/sec 5.6 Ktx/sec
stdb_raw 🧠 person unique 0 100 404.9±1.67µs 316.5±0.62µs 2.4 Ktx/sec 3.1 Ktx/sec
stdb_raw 🧠 person unique 1000 100 425.7±3.57µs 334.8±0.37µs 2.3 Ktx/sec 2.9 Ktx/sec

Full table iterate

db on disk schema index type new latency old latency new throughput old throughput
sqlite 💿 location unique 9.1±0.08µs 9.0±0.13µs 107.2 Ktx/sec 108.9 Ktx/sec
sqlite 💿 person unique 9.7±0.09µs 9.6±0.09µs 101.2 Ktx/sec 101.5 Ktx/sec
sqlite 🧠 location unique 7.9±0.06µs 7.6±0.10µs 123.6 Ktx/sec 128.3 Ktx/sec
sqlite 🧠 person unique 8.5±0.08µs 8.4±0.09µs 115.3 Ktx/sec 116.9 Ktx/sec
stdb_module 💿 location unique 46.7±5.17µs 31.5±1.98µs 20.9 Ktx/sec 31.0 Ktx/sec
stdb_module 💿 person unique 56.0±9.46µs 45.4±4.52µs 17.4 Ktx/sec 21.5 Ktx/sec
stdb_module 🧠 location unique 46.7±5.20µs 31.2±2.91µs 20.9 Ktx/sec 31.3 Ktx/sec
stdb_module 🧠 person unique 60.9±6.07µs 47.4±3.15µs 16.0 Ktx/sec 20.6 Ktx/sec
stdb_raw 💿 location unique 8.2±0.01µs 3.4±0.04µs 119.0 Ktx/sec 287.0 Ktx/sec
stdb_raw 💿 person unique 8.2±0.01µs 3.4±0.01µs 119.0 Ktx/sec 287.5 Ktx/sec
stdb_raw 🧠 location unique 8.2±0.03µs 3.4±0.01µs 118.9 Ktx/sec 287.5 Ktx/sec
stdb_raw 🧠 person unique 8.2±0.01µs 3.4±0.05µs 118.9 Ktx/sec 287.8 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.01µs 2.4±0.01µs 406.8 Ktx/sec 412.1 Ktx/sec
sqlite 🧠 u32 1000 1143.0±4.64ns 1133.8±10.54ns 854.4 Ktx/sec 861.3 Ktx/sec
stdb_module 💿 u32 1000 19.7±0.94µs 17.8±0.39µs 49.7 Ktx/sec 54.8 Ktx/sec
stdb_module 🧠 u32 1000 19.5±0.76µs 17.9±0.31µs 50.1 Ktx/sec 54.6 Ktx/sec
stdb_raw 💿 u32 1000 872.3±2.30ns 366.4±1.42ns 1119.6 Ktx/sec 2.6 Mtx/sec
stdb_raw 🧠 u32 1000 871.9±11.38ns 365.2±0.46ns 1120.0 Ktx/sec 2.6 Mtx/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.04µs 169.2 Ktx/sec 173.6 Ktx/sec
sqlite 💿 string non_indexed 1000 10 53.4±1.01µs 49.4±0.28µs 18.3 Ktx/sec 19.8 Ktx/sec
sqlite 💿 u64 indexed 1000 10 5.5±0.02µs 5.4±0.02µs 178.8 Ktx/sec 180.7 Ktx/sec
sqlite 💿 u64 non_indexed 1000 10 34.5±0.19µs 32.8±0.07µs 28.3 Ktx/sec 29.8 Ktx/sec
sqlite 🧠 string indexed 1000 10 4.2±0.02µs 4.2±0.05µs 232.1 Ktx/sec 235.1 Ktx/sec
sqlite 🧠 string non_indexed 1000 10 52.0±0.95µs 47.8±0.31µs 18.8 Ktx/sec 20.4 Ktx/sec
sqlite 🧠 u64 indexed 1000 10 4.0±0.02µs 4.0±0.02µs 244.5 Ktx/sec 246.1 Ktx/sec
sqlite 🧠 u64 non_indexed 1000 10 33.2±0.23µs 31.5±0.20µs 29.4 Ktx/sec 31.0 Ktx/sec
stdb_module 💿 string indexed 1000 10 30.1±2.52µs 22.6±1.65µs 32.4 Ktx/sec 43.2 Ktx/sec
stdb_module 💿 string non_indexed 1000 10 182.7±7.39µs 112.3±8.26µs 5.3 Ktx/sec 8.7 Ktx/sec
stdb_module 💿 u64 indexed 1000 10 24.9±2.12µs 20.5±1.30µs 39.2 Ktx/sec 47.6 Ktx/sec
stdb_module 💿 u64 non_indexed 1000 10 162.9±6.77µs 91.6±16.29µs 6.0 Ktx/sec 10.7 Ktx/sec
stdb_module 🧠 string indexed 1000 10 28.3±2.19µs 22.6±1.66µs 34.5 Ktx/sec 43.3 Ktx/sec
stdb_module 🧠 string non_indexed 1000 10 182.8±2.98µs 121.3±5.25µs 5.3 Ktx/sec 8.1 Ktx/sec
stdb_module 🧠 u64 indexed 1000 10 24.2±1.68µs 20.9±1.59µs 40.3 Ktx/sec 46.8 Ktx/sec
stdb_module 🧠 u64 non_indexed 1000 10 158.2±3.66µs 87.2±6.92µs 6.2 Ktx/sec 11.2 Ktx/sec
stdb_raw 💿 string indexed 1000 10 3.2±0.01µs 1229.9±0.95ns 301.0 Ktx/sec 794.0 Ktx/sec
stdb_raw 💿 string non_indexed 1000 10 142.8±0.47µs 80.6±0.14µs 6.8 Ktx/sec 12.1 Ktx/sec
stdb_raw 💿 u64 indexed 1000 10 3.1±0.01µs 1154.6±1.01ns 310.1 Ktx/sec 845.8 Ktx/sec
stdb_raw 💿 u64 non_indexed 1000 10 122.3±0.25µs 55.2±0.17µs 8.0 Ktx/sec 17.7 Ktx/sec
stdb_raw 🧠 string indexed 1000 10 3.3±0.04µs 1231.0±1.01ns 299.8 Ktx/sec 793.3 Ktx/sec
stdb_raw 🧠 string non_indexed 1000 10 142.6±0.38µs 79.7±0.25µs 6.9 Ktx/sec 12.3 Ktx/sec
stdb_raw 🧠 u64 indexed 1000 10 3.1±0.01µs 1153.4±1.50ns 311.0 Ktx/sec 846.7 Ktx/sec
stdb_raw 🧠 u64 non_indexed 1000 10 121.9±0.14µs 54.7±0.13µs 8.0 Ktx/sec 17.9 Ktx/sec

Serialize

schema format count new latency old latency new throughput old throughput
location bsatn 100 1711.5±50.39ns 1738.5±31.23ns 55.7 Mtx/sec 54.9 Mtx/sec
location json 100 3.4±0.05µs 3.1±0.03µs 28.1 Mtx/sec 30.8 Mtx/sec
location product_value 100 1119.9±0.69ns 845.3±0.74ns 85.2 Mtx/sec 112.8 Mtx/sec
person bsatn 100 2.9±0.01µs 2.5±0.01µs 33.1 Mtx/sec 37.9 Mtx/sec
person json 100 5.0±0.08µs 5.0±0.07µs 18.9 Mtx/sec 19.2 Mtx/sec
person product_value 100 1114.3±0.93ns 1120.1±0.59ns 85.6 Mtx/sec 85.1 Mtx/sec

Module: invoke with large arguments

arg size new latency old latency new throughput old throughput
64KiB 76.0±6.93µs 73.5±10.22µs - -

Module: print bulk

line count new latency old latency new throughput old throughput
1 20.4±0.79µs 19.5±1.19µs - -
100 202.9±8.76µs 193.9±1.48µs - -
1000 1825.2±18.29µs 1762.1±54.75µs - -

Remaining benchmarks

name new latency old latency new throughput old throughput

Please sign in to comment.