Skip to content

Commit

Permalink
refactor: encode type info implicitly in the physical plan (#1938)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshua-spacetime authored Nov 8, 2024
1 parent dd73f76 commit ce58e26
Show file tree
Hide file tree
Showing 2 changed files with 126 additions and 151 deletions.
118 changes: 66 additions & 52 deletions crates/physical-plan/src/compile.rs
Original file line number Diff line number Diff line change
@@ -1,40 +1,39 @@
//! Lowering from the logical plan to the physical plan.
use crate::plan;
use crate::plan::{CrossJoin, Filter, PhysicalCtx, PhysicalExpr, PhysicalPlan};
use crate::plan::{PhysicalCtx, PhysicalExpr, PhysicalPlan};
use spacetimedb_expr::expr::{Expr, Let, LetCtx, Project, RelExpr, Select};
use spacetimedb_expr::statement::Statement;
use spacetimedb_expr::ty::{TyCtx, TyId};
use spacetimedb_expr::ty::{TyCtx, Type};
use spacetimedb_expr::StatementCtx;
use spacetimedb_sql_parser::ast::BinOp;

fn compile_expr(_ctx: &TyCtx, vars: &LetCtx, expr: Expr) -> PhysicalExpr {
fn compile_expr(ctx: &TyCtx, vars: &LetCtx, expr: Expr) -> PhysicalExpr {
match expr {
Expr::Bin(op, lhs, rhs) => {
let lhs = compile_expr(_ctx, vars, *lhs);
let rhs = compile_expr(_ctx, vars, *rhs);
let lhs = compile_expr(ctx, vars, *lhs);
let rhs = compile_expr(ctx, vars, *rhs);
PhysicalExpr::BinOp(op, Box::new(lhs), Box::new(rhs))
}
Expr::Var(sym, _ty) => {
let var = vars.get_var(sym).cloned().unwrap();
compile_expr(_ctx, vars, var)
compile_expr(ctx, vars, var)
}
Expr::Row(row, ty) => {
Expr::Row(row, _) => {
PhysicalExpr::Tuple(
row.into_vec()
.into_iter()
// The `sym` is inline in `expr`
.map(|(_sym, expr)| compile_expr(_ctx, vars, expr))
.map(|(_sym, expr)| compile_expr(ctx, vars, expr))
.collect(),
ty,
)
}
Expr::Lit(value, ty) => PhysicalExpr::Value(value, ty),
Expr::Field(expr, pos, ty) => {
let expr = compile_expr(_ctx, vars, *expr);
PhysicalExpr::Field(Box::new(expr), pos, ty)
Expr::Lit(value, _) => PhysicalExpr::Value(value),
Expr::Field(expr, pos, _) => {
let expr = compile_expr(ctx, vars, *expr);
PhysicalExpr::Field(Box::new(expr), pos)
}
Expr::Input(ty) => PhysicalExpr::Input(ty),
Expr::Input(ty) if matches!(*ctx.try_resolve(ty).unwrap(), Type::Var(..)) => PhysicalExpr::Ptr,
Expr::Input(_) => PhysicalExpr::Tup,
}
}

Expand All @@ -54,35 +53,24 @@ fn compile_let(ctx: &TyCtx, Let { vars, exprs }: Let) -> Vec<PhysicalExpr> {
fn compile_filter(ctx: &TyCtx, select: Select) -> PhysicalPlan {
let input = compile_rel_expr(ctx, select.input);
if let Some(op) = join_exprs(compile_let(ctx, select.expr)) {
PhysicalPlan::Filter(Filter {
input: Box::new(input),
op,
})
PhysicalPlan::Filter(Box::new(input), op)
} else {
input
}
}

fn compile_project(ctx: &TyCtx, expr: Project) -> PhysicalPlan {
let proj = plan::Project {
input: Box::new(compile_rel_expr(ctx, expr.input)),
op: join_exprs(compile_let(ctx, expr.expr)).unwrap(),
};
let input = Box::new(compile_rel_expr(ctx, expr.input));
let op = join_exprs(compile_let(ctx, expr.expr)).unwrap();

PhysicalPlan::Project(proj)
PhysicalPlan::Project(input, op)
}

fn compile_cross_joins(ctx: &TyCtx, joins: Vec<RelExpr>, ty: TyId) -> PhysicalPlan {
fn compile_cross_joins(ctx: &TyCtx, joins: Vec<RelExpr>) -> PhysicalPlan {
joins
.into_iter()
.map(|expr| compile_rel_expr(ctx, expr))
.reduce(|lhs, rhs| {
PhysicalPlan::CrossJoin(CrossJoin {
lhs: Box::new(lhs),
rhs: Box::new(rhs),
ty,
})
})
.reduce(|lhs, rhs| PhysicalPlan::NLJoin(Box::new(lhs), Box::new(rhs)))
.unwrap()
}

Expand All @@ -91,7 +79,7 @@ fn compile_rel_expr(ctx: &TyCtx, ast: RelExpr) -> PhysicalPlan {
RelExpr::RelVar(table, _ty) => PhysicalPlan::TableScan(table),
RelExpr::Select(select) => compile_filter(ctx, *select),
RelExpr::Proj(proj) => compile_project(ctx, *proj),
RelExpr::Join(joins, ty) => compile_cross_joins(ctx, joins.into_vec(), ty),
RelExpr::Join(joins, _) => compile_cross_joins(ctx, joins.into_vec()),
RelExpr::Union(_, _) | RelExpr::Minus(_, _) | RelExpr::Dedup(_) => {
unreachable!("DISTINCT is not implemented")
}
Expand Down Expand Up @@ -165,24 +153,50 @@ mod tests {
Ok(statement)
}

impl PhysicalPlan {
pub fn as_project(&self) -> Option<(&PhysicalPlan, &PhysicalExpr)> {
if let PhysicalPlan::Project(input, expr) = self {
Some((input, expr))
} else {
None
}
}

pub fn as_filter(&self) -> Option<(&PhysicalPlan, &PhysicalExpr)> {
if let PhysicalPlan::Filter(input, expr) = self {
Some((input, expr))
} else {
None
}
}

pub fn as_nljoin(&self) -> Option<(&PhysicalPlan, &PhysicalPlan)> {
if let PhysicalPlan::NLJoin(lhs, rhs) = self {
Some((lhs, rhs))
} else {
None
}
}
}

#[test]
fn test_project() -> ResultTest<()> {
let (ast, ctx) = compile_sql_sub_test("SELECT * FROM t")?;
assert!(matches!(compile(&ctx, ast).plan, PhysicalPlan::TableScan(_)));

let ast = compile_sql_stmt_test("SELECT u32 FROM t")?;
assert!(matches!(compile(&ctx, ast).plan, PhysicalPlan::Project(_)));
assert!(matches!(compile(&ctx, ast).plan, PhysicalPlan::Project(..)));

Ok(())
}

#[test]
fn test_select() -> ResultTest<()> {
let (ast, ctx) = compile_sql_sub_test("SELECT * FROM t WHERE u32 = 1")?;
assert!(matches!(compile(&ctx, ast).plan, PhysicalPlan::Filter(_)));
assert!(matches!(compile(&ctx, ast).plan, PhysicalPlan::Filter(..)));

let (ast, ctx) = compile_sql_sub_test("SELECT * FROM t WHERE u32 = 1 AND f32 = f32")?;
assert!(matches!(compile(&ctx, ast).plan, PhysicalPlan::Filter(_)));
assert!(matches!(compile(&ctx, ast).plan, PhysicalPlan::Filter(..)));
Ok(())
}

Expand All @@ -191,35 +205,35 @@ mod tests {
// Check we can do a cross join
let (ast, ctx) = compile_sql_sub_test("SELECT t.* FROM t JOIN u")?;
let ast = compile(&ctx, ast).plan;
let plan::Project { input, op } = ast.as_project().unwrap();
let CrossJoin { lhs, rhs, ty: _ } = input.as_cross().unwrap();
let (input, op) = ast.as_project().unwrap();
let (lhs, rhs) = input.as_nljoin().unwrap();

assert!(matches!(op, PhysicalExpr::Field(_, _, _)));
assert!(matches!(&**lhs, PhysicalPlan::TableScan(_)));
assert!(matches!(&**rhs, PhysicalPlan::TableScan(_)));
assert!(matches!(op, PhysicalExpr::Field(..)));
assert!(matches!(lhs, PhysicalPlan::TableScan(_)));
assert!(matches!(rhs, PhysicalPlan::TableScan(_)));

// Check we can do multiple joins
let (ast, ctx) = compile_sql_sub_test("SELECT t.* FROM t JOIN u JOIN x")?;
let ast = compile(&ctx, ast).plan;
let plan::Project { input, op: _ } = ast.as_project().unwrap();
let CrossJoin { lhs, rhs, ty: _ } = input.as_cross().unwrap();
assert!(matches!(&**rhs, PhysicalPlan::TableScan(_)));
let (input, _) = ast.as_project().unwrap();
let (lhs, rhs) = input.as_nljoin().unwrap();
assert!(matches!(rhs, PhysicalPlan::TableScan(_)));

let CrossJoin { lhs, rhs, ty: _ } = lhs.as_cross().unwrap();
assert!(matches!(&**lhs, PhysicalPlan::TableScan(_)));
assert!(matches!(&**rhs, PhysicalPlan::TableScan(_)));
let (lhs, rhs) = lhs.as_nljoin().unwrap();
assert!(matches!(lhs, PhysicalPlan::TableScan(_)));
assert!(matches!(rhs, PhysicalPlan::TableScan(_)));

// Check we can do a join with a filter
let (ast, ctx) = compile_sql_sub_test("SELECT t.* FROM t JOIN u ON t.u32 = u.u32")?;
let ast = compile(&ctx, ast).plan;

let plan::Project { input, op: _ } = ast.as_project().unwrap();
let Filter { input, op } = input.as_filter().unwrap();
let (input, _) = ast.as_project().unwrap();
let (input, op) = input.as_filter().unwrap();
assert!(matches!(op, PhysicalExpr::BinOp(_, _, _)));

let CrossJoin { lhs, rhs, ty: _ } = input.as_cross().unwrap();
assert!(matches!(&**lhs, PhysicalPlan::TableScan(_)));
assert!(matches!(&**rhs, PhysicalPlan::TableScan(_)));
let (lhs, rhs) = input.as_nljoin().unwrap();
assert!(matches!(lhs, PhysicalPlan::TableScan(_)));
assert!(matches!(rhs, PhysicalPlan::TableScan(_)));

Ok(())
}
Expand Down
Loading

2 comments on commit ce58e26

@github-actions
Copy link

@github-actions github-actions bot commented on ce58e26 Nov 8, 2024

Choose a reason for hiding this comment

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

Callgrind benchmark results

Callgrind Benchmark Report

These benchmarks were run using callgrind,
an instruction-level profiler. They allow comparisons between sqlite (sqlite), SpacetimeDB running through a module (stdb_module), and the underlying SpacetimeDB data storage engine (stdb_raw). Callgrind emulates a CPU to collect the below estimates.

Measurement changes larger than five percent are in bold.

In-memory benchmarks

callgrind: empty transaction

db total reads + writes old total reads + writes Δrw estimated cycles old estimated cycles Δcycles
stdb_raw 6399 6399 0.00% 6523 6523 0.00%
sqlite 5579 5579 0.00% 6019 6019 0.00%

callgrind: filter

db schema indices count preload _column data_type total reads + writes old total reads + writes Δrw estimated cycles old estimated cycles Δcycles
stdb_raw u32_u64_str no_index 64 128 1 u64 76593 76593 0.00% 77005 77013 -0.01%
stdb_raw u32_u64_str no_index 64 128 2 string 119091 120180 -0.91% 119771 120792 -0.85%
stdb_raw u32_u64_str btree_each_column 64 128 2 string 25099 25085 0.06% 25603 25641 -0.15%
stdb_raw u32_u64_str btree_each_column 64 128 1 u64 24051 24051 0.00% 24419 24419 0.00%
sqlite u32_u64_str no_index 64 128 2 string 144728 144695 0.02% 146298 146257 0.03%
sqlite u32_u64_str no_index 64 128 1 u64 124044 124044 0.00% 125334 125334 0.00%
sqlite u32_u64_str btree_each_column 64 128 1 u64 131361 131361 0.00% 132811 132811 0.00%
sqlite u32_u64_str btree_each_column 64 128 2 string 134494 134494 0.00% 136104 136096 0.01%

callgrind: insert bulk

db schema indices count preload total reads + writes old total reads + writes Δrw estimated cycles old estimated cycles Δcycles
stdb_raw u32_u64_str unique_0 64 128 876657 877044 -0.04% 900493 931998 -3.38%
stdb_raw u32_u64_str btree_each_column 64 128 1027498 1026659 0.08% 1099902 1068451 2.94%
sqlite u32_u64_str unique_0 64 128 398320 398320 0.00% 415178 415178 0.00%
sqlite u32_u64_str btree_each_column 64 128 983637 983637 0.00% 1020525 1020521 0.00%

callgrind: iterate

db schema indices count total reads + writes old total reads + writes Δrw estimated cycles old estimated cycles Δcycles
stdb_raw u32_u64_str unique_0 1024 153726 153726 0.00% 153866 153866 0.00%
stdb_raw u32_u64_str unique_0 64 16751 16751 0.00% 16875 16875 0.00%
sqlite u32_u64_str unique_0 1024 1067255 1067255 0.00% 1070663 1070663 0.00%
sqlite u32_u64_str unique_0 64 76207 76207 0.00% 77445 77445 0.00%

callgrind: serialize_product_value

count format total reads + writes old total reads + writes Δrw estimated cycles old estimated cycles Δcycles
64 json 47528 47528 0.00% 50282 50282 0.00%
64 bsatn 25509 25509 0.00% 27821 27821 0.00%
16 bsatn 8200 8200 0.00% 9628 9628 0.00%
16 json 12188 12188 0.00% 14194 14194 0.00%

callgrind: update bulk

db schema indices count preload total reads + writes old total reads + writes Δrw estimated cycles old estimated cycles Δcycles
stdb_raw u32_u64_str unique_0 1024 1024 20490346 20076320 2.06% 21133358 20646444 2.36%
stdb_raw u32_u64_str unique_0 64 128 1284412 1285051 -0.05% 1356918 1327185 2.24%
sqlite u32_u64_str unique_0 1024 1024 1802182 1802182 0.00% 1811362 1811362 0.00%
sqlite u32_u64_str unique_0 64 128 128528 128528 0.00% 131492 131492 0.00%
On-disk benchmarks

callgrind: empty transaction

db total reads + writes old total reads + writes Δrw estimated cycles old estimated cycles Δcycles
stdb_raw 6404 6404 0.00% 6544 6544 0.00%
sqlite 5621 5621 0.00% 6121 6121 0.00%

callgrind: filter

db schema indices count preload _column data_type total reads + writes old total reads + writes Δrw estimated cycles old estimated cycles Δcycles
stdb_raw u32_u64_str no_index 64 128 1 u64 76598 76598 0.00% 76978 76982 -0.01%
stdb_raw u32_u64_str no_index 64 128 2 string 119096 119096 0.00% 119720 119852 -0.11%
stdb_raw u32_u64_str btree_each_column 64 128 2 string 25088 25333 -0.97% 25560 25857 -1.15%
stdb_raw u32_u64_str btree_each_column 64 128 1 u64 24056 24056 0.00% 24400 24400 0.00%
sqlite u32_u64_str no_index 64 128 1 u64 125965 125965 0.00% 127547 127547 0.00%
sqlite u32_u64_str no_index 64 128 2 string 146616 146616 0.00% 148454 148450 0.00%
sqlite u32_u64_str btree_each_column 64 128 2 string 136616 136616 0.00% 138724 138724 0.00%
sqlite u32_u64_str btree_each_column 64 128 1 u64 133457 133457 0.00% 135341 135341 0.00%

callgrind: insert bulk

db schema indices count preload total reads + writes old total reads + writes Δrw estimated cycles old estimated cycles Δcycles
stdb_raw u32_u64_str unique_0 64 128 826060 826664 -0.07% 879906 880466 -0.06%
stdb_raw u32_u64_str btree_each_column 64 128 976036 975398 0.07% 1046502 1046160 0.03%
sqlite u32_u64_str unique_0 64 128 415857 415857 0.00% 431871 431871 0.00%
sqlite u32_u64_str btree_each_column 64 128 1021898 1021898 0.00% 1057598 1057614 -0.00%

callgrind: iterate

db schema indices count total reads + writes old total reads + writes Δrw estimated cycles old estimated cycles Δcycles
stdb_raw u32_u64_str unique_0 1024 153731 153731 0.00% 153855 153855 0.00%
stdb_raw u32_u64_str unique_0 64 16756 16756 0.00% 16880 16876 0.02%
sqlite u32_u64_str unique_0 1024 1070323 1070323 0.00% 1074097 1074097 0.00%
sqlite u32_u64_str unique_0 64 77973 77973 0.00% 79303 79303 0.00%

callgrind: serialize_product_value

count format total reads + writes old total reads + writes Δrw estimated cycles old estimated cycles Δcycles
64 json 47528 47528 0.00% 50282 50282 0.00%
64 bsatn 25509 25509 0.00% 27821 27821 0.00%
16 bsatn 8200 8200 0.00% 9628 9628 0.00%
16 json 12188 12188 0.00% 14194 14194 0.00%

callgrind: update bulk

db schema indices count preload total reads + writes old total reads + writes Δrw estimated cycles old estimated cycles Δcycles
stdb_raw u32_u64_str unique_0 1024 1024 19003455 19002051 0.01% 19662023 19656511 0.03%
stdb_raw u32_u64_str unique_0 64 128 1237471 1237908 -0.04% 1309767 1309022 0.06%
sqlite u32_u64_str unique_0 1024 1024 1809743 1809743 0.00% 1818455 1818455 0.00%
sqlite u32_u64_str unique_0 64 128 132654 132654 0.00% 135834 135834 0.00%

@github-actions
Copy link

@github-actions github-actions bot commented on ce58e26 Nov 8, 2024

Choose a reason for hiding this comment

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

Criterion benchmark results

Criterion benchmark report

YOU SHOULD PROBABLY IGNORE THESE RESULTS.

Criterion is a wall time based benchmarking system that is extremely noisy when run on CI. We collect these results for longitudinal analysis, but they are not reliable for comparing individual PRs.

Go look at the callgrind report instead.

empty

db on disk new latency old latency new throughput old throughput
sqlite 💿 418.8±3.77ns 419.8±2.00ns - -
sqlite 🧠 407.1±2.30ns 413.5±2.51ns - -
stdb_raw 💿 777.6±1.22ns 775.6±1.29ns - -
stdb_raw 🧠 777.2±0.85ns 776.2±1.53ns - -

insert_1

db on disk schema indices preload new latency old latency new throughput old throughput

insert_bulk

db on disk schema indices preload count new latency old latency new throughput old throughput
sqlite 💿 u32_u64_str btree_each_column 2048 256 585.1±0.69µs 591.0±0.70µs 1709 tx/sec 1692 tx/sec
sqlite 💿 u32_u64_str unique_0 2048 256 149.4±0.91µs 153.9±1.04µs 6.5 Ktx/sec 6.3 Ktx/sec
sqlite 💿 u32_u64_u64 btree_each_column 2048 256 468.8±0.74µs 472.3±0.43µs 2.1 Ktx/sec 2.1 Ktx/sec
sqlite 💿 u32_u64_u64 unique_0 2048 256 137.0±0.47µs 140.9±0.88µs 7.1 Ktx/sec 6.9 Ktx/sec
sqlite 🧠 u32_u64_str btree_each_column 2048 256 445.5±0.39µs 450.8±0.54µs 2.2 Ktx/sec 2.2 Ktx/sec
sqlite 🧠 u32_u64_str unique_0 2048 256 123.4±0.69µs 125.6±0.41µs 7.9 Ktx/sec 7.8 Ktx/sec
sqlite 🧠 u32_u64_u64 btree_each_column 2048 256 367.4±0.59µs 372.8±0.66µs 2.7 Ktx/sec 2.6 Ktx/sec
sqlite 🧠 u32_u64_u64 unique_0 2048 256 106.3±0.50µs 107.8±0.65µs 9.2 Ktx/sec 9.1 Ktx/sec
stdb_raw 💿 u32_u64_str btree_each_column 2048 256 591.0±22.09µs 604.6±26.90µs 1692 tx/sec 1653 tx/sec
stdb_raw 💿 u32_u64_str unique_0 2048 256 479.0±23.81µs 408.7±53.76µs 2.0 Ktx/sec 2.4 Ktx/sec
stdb_raw 💿 u32_u64_u64 btree_each_column 2048 256 374.2±7.73µs 368.9±10.25µs 2.6 Ktx/sec 2.6 Ktx/sec
stdb_raw 💿 u32_u64_u64 unique_0 2048 256 338.4±21.42µs 344.6±6.96µs 2.9 Ktx/sec 2.8 Ktx/sec
stdb_raw 🧠 u32_u64_str btree_each_column 2048 256 295.3±0.64µs 297.0±0.38µs 3.3 Ktx/sec 3.3 Ktx/sec
stdb_raw 🧠 u32_u64_str unique_0 2048 256 230.4±0.46µs 229.4±0.31µs 4.2 Ktx/sec 4.3 Ktx/sec
stdb_raw 🧠 u32_u64_u64 btree_each_column 2048 256 235.6±0.36µs 235.9±0.14µs 4.1 Ktx/sec 4.1 Ktx/sec
stdb_raw 🧠 u32_u64_u64 unique_0 2048 256 207.7±0.25µs 207.1±0.23µs 4.7 Ktx/sec 4.7 Ktx/sec

iterate

db on disk schema indices new latency old latency new throughput old throughput
sqlite 💿 u32_u64_str unique_0 23.8±0.07µs 24.7±0.15µs 41.0 Ktx/sec 39.6 Ktx/sec
sqlite 💿 u32_u64_u64 unique_0 20.5±0.03µs 22.3±0.08µs 47.7 Ktx/sec 43.9 Ktx/sec
sqlite 🧠 u32_u64_str unique_0 21.5±0.13µs 21.9±0.09µs 45.4 Ktx/sec 44.5 Ktx/sec
sqlite 🧠 u32_u64_u64 unique_0 18.0±0.04µs 19.7±0.12µs 54.3 Ktx/sec 49.6 Ktx/sec
stdb_raw 💿 u32_u64_str unique_0 4.9±0.00µs 4.9±0.00µs 200.3 Ktx/sec 199.8 Ktx/sec
stdb_raw 💿 u32_u64_u64 unique_0 4.8±0.00µs 4.8±0.00µs 204.3 Ktx/sec 203.8 Ktx/sec
stdb_raw 🧠 u32_u64_str unique_0 4.9±0.00µs 4.9±0.00µs 200.3 Ktx/sec 200.0 Ktx/sec
stdb_raw 🧠 u32_u64_u64 unique_0 4.8±0.00µs 4.8±0.00µs 204.4 Ktx/sec 203.9 Ktx/sec

find_unique

db on disk key type preload 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 67.0±0.08µs 69.9±0.46µs 14.6 Ktx/sec 14.0 Ktx/sec
sqlite 💿 u64 index 2048 256 61.4±0.12µs 65.1±0.19µs 15.9 Ktx/sec 15.0 Ktx/sec
sqlite 🧠 string index 2048 256 63.4±0.06µs 65.2±0.28µs 15.4 Ktx/sec 15.0 Ktx/sec
sqlite 🧠 u64 index 2048 256 56.4±0.14µs 59.1±0.55µs 17.3 Ktx/sec 16.5 Ktx/sec
stdb_raw 💿 string index 2048 256 5.2±0.00µs 5.1±0.00µs 189.1 Ktx/sec 192.7 Ktx/sec
stdb_raw 💿 u64 index 2048 256 5.1±0.00µs 5.0±0.00µs 192.7 Ktx/sec 195.8 Ktx/sec
stdb_raw 🧠 string index 2048 256 5.2±0.00µs 5.1±0.00µs 188.9 Ktx/sec 192.8 Ktx/sec
stdb_raw 🧠 u64 index 2048 256 5.1±0.00µs 5.0±0.00µs 192.9 Ktx/sec 195.9 Ktx/sec

serialize

schema format count new latency old latency new throughput old throughput
u32_u64_str bflatn_to_bsatn_fast_path 100 3.6±0.01µs 3.6±0.00µs 26.5 Mtx/sec 26.5 Mtx/sec
u32_u64_str bflatn_to_bsatn_slow_path 100 3.6±0.01µs 3.6±0.02µs 26.7 Mtx/sec 26.5 Mtx/sec
u32_u64_str bsatn 100 15.6±0.15ns 15.7±0.12ns 6.0 Gtx/sec 5.9 Gtx/sec
u32_u64_str bsatn 100 2.4±0.02µs 2.4±0.00µs 39.5 Mtx/sec 39.6 Mtx/sec
u32_u64_str json 100 4.9±0.04µs 5.1±0.04µs 19.4 Mtx/sec 18.9 Mtx/sec
u32_u64_str json 100 8.5±0.06µs 8.2±0.06µs 11.3 Mtx/sec 11.6 Mtx/sec
u32_u64_str product_value 100 1019.4±0.50ns 1018.5±3.21ns 93.5 Mtx/sec 93.6 Mtx/sec
u32_u64_u64 bflatn_to_bsatn_fast_path 100 1015.0±1.87ns 1018.8±3.86ns 94.0 Mtx/sec 93.6 Mtx/sec
u32_u64_u64 bflatn_to_bsatn_slow_path 100 2.8±0.00µs 2.8±0.03µs 34.3 Mtx/sec 34.2 Mtx/sec
u32_u64_u64 bsatn 100 14.8±0.02ns 14.8±0.01ns 6.3 Gtx/sec 6.3 Gtx/sec
u32_u64_u64 bsatn 100 1736.3±20.46ns 1741.0±21.45ns 54.9 Mtx/sec 54.8 Mtx/sec
u32_u64_u64 json 100 3.3±0.03µs 3.1±0.01µs 28.8 Mtx/sec 30.7 Mtx/sec
u32_u64_u64 json 100 5.9±0.01µs 6.0±0.02µs 16.0 Mtx/sec 15.9 Mtx/sec
u32_u64_u64 product_value 100 1018.1±1.32ns 1016.0±3.81ns 93.7 Mtx/sec 93.9 Mtx/sec
u64_u64_u32 bflatn_to_bsatn_fast_path 100 759.6±0.88ns 767.4±9.09ns 125.6 Mtx/sec 124.3 Mtx/sec
u64_u64_u32 bflatn_to_bsatn_slow_path 100 2.8±0.00µs 2.8±0.00µs 34.3 Mtx/sec 34.2 Mtx/sec
u64_u64_u32 bsatn 100 1737.5±23.50ns 1745.2±20.38ns 54.9 Mtx/sec 54.6 Mtx/sec
u64_u64_u32 bsatn 100 689.4±0.84ns 706.0±0.63ns 138.3 Mtx/sec 135.1 Mtx/sec
u64_u64_u32 json 100 3.4±0.04µs 3.1±0.01µs 28.1 Mtx/sec 30.3 Mtx/sec
u64_u64_u32 json 100 6.0±0.06µs 5.8±0.01µs 15.8 Mtx/sec 16.3 Mtx/sec
u64_u64_u32 product_value 100 1021.8±0.86ns 1014.1±0.57ns 93.3 Mtx/sec 94.0 Mtx/sec

stdb_module_large_arguments

arg size new latency old latency new throughput old throughput
64KiB 104.1±6.81µs 97.4±7.28µs - -

stdb_module_print_bulk

line count new latency old latency new throughput old throughput
1 55.0±4.60µs 53.9±4.08µs - -
100 600.2±6.79µs 603.9±6.34µs - -
1000 4.4±0.68ms 4.0±0.84ms - -

remaining

name new latency old latency new throughput old throughput
special/db_game/circles/load=10 41.7±3.53ms 49.8±8.65ms - -
special/db_game/circles/load=100 38.9±3.98ms 37.3±1.65ms - -
special/db_game/ia_loop/load=500 150.4±1.13ms 149.5±1.07ms - -
special/db_game/ia_loop/load=5000 5.3±0.03s 5.4±0.02s - -
sqlite/💿/update_bulk/u32_u64_str/unique_0/load=2048/count=256 53.7±0.21µs 55.2±0.28µs 18.2 Ktx/sec 17.7 Ktx/sec
sqlite/💿/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 45.7±0.08µs 48.2±0.14µs 21.4 Ktx/sec 20.3 Ktx/sec
sqlite/🧠/update_bulk/u32_u64_str/unique_0/load=2048/count=256 39.0±0.15µs 40.7±0.34µs 25.0 Ktx/sec 24.0 Ktx/sec
sqlite/🧠/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 35.2±0.03µs 36.6±0.17µs 27.8 Ktx/sec 26.7 Ktx/sec
stdb_module/💿/update_bulk/u32_u64_str/unique_0/load=2048/count=256 1253.0±6.70µs 1262.7±8.08µs 798 tx/sec 791 tx/sec
stdb_module/💿/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 1005.7±13.61µs 1009.2±9.15µs 994 tx/sec 990 tx/sec
stdb_raw/💿/update_bulk/u32_u64_str/unique_0/load=2048/count=256 525.2±14.72µs 534.1±7.03µs 1904 tx/sec 1872 tx/sec
stdb_raw/💿/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 480.5±10.16µs 478.7±7.29µs 2.0 Ktx/sec 2.0 Ktx/sec
stdb_raw/🧠/update_bulk/u32_u64_str/unique_0/load=2048/count=256 360.8±0.56µs 365.6±0.26µs 2.7 Ktx/sec 2.7 Ktx/sec
stdb_raw/🧠/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 327.1±0.56µs 327.0±0.48µs 3.0 Ktx/sec 3.0 Ktx/sec

Please sign in to comment.