Skip to content

Commit

Permalink
Flatten ColumnOp so that we box less (#1234)
Browse files Browse the repository at this point in the history
  • Loading branch information
Centril committed Jun 3, 2024
1 parent 89aecd1 commit be9c958
Show file tree
Hide file tree
Showing 4 changed files with 206 additions and 264 deletions.
71 changes: 17 additions & 54 deletions crates/core/src/sql/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ mod tests {
use crate::sql::execute::tests::run_for_testing;
use crate::vm::tests::create_table_with_rows;
use spacetimedb_lib::error::{ResultTest, TestError};
use spacetimedb_lib::operator::OpQuery;
use spacetimedb_lib::{Address, Identity};
use spacetimedb_primitives::{col_list, ColList, TableId};
use spacetimedb_sats::{product, AlgebraicType, AlgebraicValue, ProductType};
Expand Down Expand Up @@ -634,25 +633,16 @@ mod tests {
assert_eq!(source_lhs.table_id().unwrap(), lhs_id);
assert_eq!(query.len(), 2);

// The first operation in the pipeline should be a selection
let Query::Select(ColumnOp::Cmp {
op: OpQuery::Cmp(OpCmp::Eq),
ref lhs,
ref rhs,
// The first operation in the pipeline should be a selection with `col#0 = 3`
let Query::Select(ColumnOp::ColCmpVal {
cmp: OpCmp::Eq,
lhs: ColId(0),
rhs: AlgebraicValue::U64(3),
}) = query[0]
else {
panic!("unexpected operator {:#?}", query[0]);
};

let ColumnOp::Col(ColExpr::Col(col)) = **lhs else {
panic!("unexpected left hand side {:#?}", **lhs);
};
assert_eq!(col, 0.into());

let ColumnOp::Col(ColExpr::Value(AlgebraicValue::U64(3))) = **rhs else {
panic!("unexpected right hand side {:#?}", **rhs);
};

// The join should follow the selection
let Query::JoinInner(JoinExpr {
ref rhs,
Expand Down Expand Up @@ -718,23 +708,14 @@ mod tests {
assert_eq!(&**inner_header, &source_lhs.head().extend(rhs.source.head()));

// The selection should be pushed onto the rhs of the join
let Query::Select(ColumnOp::Cmp {
op: OpQuery::Cmp(OpCmp::Eq),
ref lhs,
ref rhs,
let Query::Select(ColumnOp::ColCmpVal {
cmp: OpCmp::Eq,
lhs: ColId(1),
rhs: AlgebraicValue::U64(3),
}) = rhs.query[0]
else {
panic!("unexpected operator {:#?}", rhs.query[0]);
};

let ColumnOp::Col(ColExpr::Col(col)) = **lhs else {
panic!("unexpected left hand side {:#?}", **lhs);
};
assert_eq!(col, 1.into());

let ColumnOp::Col(ColExpr::Value(AlgebraicValue::U64(3))) = **rhs else {
panic!("unexpected right hand side {:#?}", **rhs);
};
Ok(())
}

Expand Down Expand Up @@ -876,23 +857,14 @@ mod tests {
assert_eq!(table_id, rhs_id);

// Followed by a selection
let Query::Select(ColumnOp::Cmp {
op: OpQuery::Cmp(OpCmp::Eq),
lhs: ref field,
rhs: ref value,
let Query::Select(ColumnOp::ColCmpVal {
cmp: OpCmp::Eq,
lhs: ColId(2),
rhs: AlgebraicValue::U64(3),
}) = rhs[1]
else {
panic!("unexpected operator {:#?}", rhs[0]);
};

let ColumnOp::Col(ColExpr::Col(col)) = **field else {
panic!("unexpected left hand side {:#?}", field);
};
assert_eq!(col, 2.into());

let ColumnOp::Col(ColExpr::Value(AlgebraicValue::U64(3))) = **value else {
panic!("unexpected right hand side {:#?}", value);
};
Ok(())
}

Expand Down Expand Up @@ -962,23 +934,14 @@ mod tests {
assert_eq!(table_id, rhs_id);

// Followed by a selection
let Query::Select(ColumnOp::Cmp {
op: OpQuery::Cmp(OpCmp::Eq),
lhs: ref field,
rhs: ref value,
let Query::Select(ColumnOp::ColCmpVal {
cmp: OpCmp::Eq,
lhs: ColId(2),
rhs: AlgebraicValue::U64(3),
}) = rhs[1]
else {
panic!("unexpected operator {:#?}", rhs[0]);
};

let ColumnOp::Col(ColExpr::Col(col)) = **field else {
panic!("unexpected left hand side {:#?}", field);
};
assert_eq!(col, 2.into());

let ColumnOp::Col(ColExpr::Value(AlgebraicValue::U64(3))) = **value else {
panic!("unexpected right hand side {:#?}", value);
};
Ok(())
}

Expand Down
6 changes: 3 additions & 3 deletions crates/core/src/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ static_assert_size!(IndexSemiJoinLeft<Box<IterRows<'static>>>, 312);

impl<'a, Rhs: RelOps<'a>> IndexSemiJoinLeft<'a, '_, Rhs> {
fn filter(&self, index_row: &RelValue<'_>) -> bool {
self.index_select.as_ref().map_or(true, |op| op.compare(index_row))
self.index_select.as_ref().map_or(true, |op| op.eval_bool(index_row))
}
}

Expand Down Expand Up @@ -335,7 +335,7 @@ impl<'a, Rhs: RelOps<'a>> RelOps<'a> for IndexSemiJoinLeft<'a, '_, Rhs> {
}
}

/// An index join operator that returns matching rows from the index side.
/// An index join operator that returns matching rows from the probe side.
pub struct IndexSemiJoinRight<'a, 'c, Rhs: RelOps<'a>> {
/// An iterator for the probe side.
/// The values returned will be used to probe the index.
Expand All @@ -360,7 +360,7 @@ static_assert_size!(IndexSemiJoinRight<Box<IterRows<'static>>>, 64);

impl<'a, Rhs: RelOps<'a>> IndexSemiJoinRight<'a, '_, Rhs> {
fn filter(&self, index_row: &RelValue<'_>) -> bool {
self.index_select.as_ref().map_or(true, |op| op.compare(index_row))
self.index_select.as_ref().map_or(true, |op| op.eval_bool(index_row))
}
}

Expand Down
3 changes: 1 addition & 2 deletions crates/vm/src/eval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use spacetimedb_sats::ProductValue;
pub type IterRows<'a> = dyn RelOps<'a> + 'a;

pub fn build_select<'a>(base: impl RelOps<'a> + 'a, cmp: &'a ColumnOp) -> Box<IterRows<'a>> {
Box::new(base.select(move |row| cmp.compare(row)))
Box::new(base.select(move |row| cmp.eval_bool(row)))
}

pub fn build_project<'a>(base: impl RelOps<'a> + 'a, proj: &'a ProjectExpr) -> Box<IterRows<'a>> {
Expand Down Expand Up @@ -306,7 +306,6 @@ pub mod tests {
let second_source_expr = sources.add_mem_table(table);

let q = QueryExpr::new(source_expr).with_join_inner(second_source_expr, col, col, false);
dbg!(&q);
let result = run_query(q.into(), sources);

// The expected result.
Expand Down
Loading

3 comments on commit be9c958

@github-actions
Copy link

@github-actions github-actions bot commented on be9c958 Jun 3, 2024

Choose a reason for hiding this comment

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

Bot test failed. Please check the workflow run for details.

@github-actions
Copy link

@github-actions github-actions bot commented on be9c958 Jun 3, 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 💿 423.6±1.10ns 432.3±1.99ns - -
sqlite 🧠 417.2±0.92ns 424.7±1.85ns - -
stdb_raw 💿 730.4±0.73ns 721.1±0.98ns - -
stdb_raw 🧠 700.4±1.35ns 690.9±1.25ns - -

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 521.3±0.73µs 521.1±0.63µs 1918 tx/sec 1918 tx/sec
sqlite 💿 u32_u64_str unique_0 2048 256 139.0±0.59µs 138.5±0.58µs 7.0 Ktx/sec 7.1 Ktx/sec
sqlite 💿 u32_u64_u64 btree_each_column 2048 256 421.2±0.88µs 430.5±25.06µs 2.3 Ktx/sec 2.3 Ktx/sec
sqlite 💿 u32_u64_u64 unique_0 2048 256 124.1±0.38µs 123.6±0.59µs 7.9 Ktx/sec 7.9 Ktx/sec
sqlite 🧠 u32_u64_str btree_each_column 2048 256 451.4±0.90µs 453.1±0.78µs 2.2 Ktx/sec 2.2 Ktx/sec
sqlite 🧠 u32_u64_str unique_0 2048 256 124.1±0.64µs 124.2±0.51µs 7.9 Ktx/sec 7.9 Ktx/sec
sqlite 🧠 u32_u64_u64 btree_each_column 2048 256 367.0±0.37µs 368.8±0.62µs 2.7 Ktx/sec 2.6 Ktx/sec
sqlite 🧠 u32_u64_u64 unique_0 2048 256 106.9±0.29µs 107.3±0.62µs 9.1 Ktx/sec 9.1 Ktx/sec
stdb_raw 💿 u32_u64_str btree_each_column 2048 256 575.4±23.22µs 486.7±11.65µs 1737 tx/sec 2.0 Ktx/sec
stdb_raw 💿 u32_u64_str unique_0 2048 256 491.3±21.23µs 409.1±13.60µs 2035 tx/sec 2.4 Ktx/sec
stdb_raw 💿 u32_u64_u64 btree_each_column 2048 256 367.3±7.58µs 362.4±7.14µs 2.7 Ktx/sec 2.7 Ktx/sec
stdb_raw 💿 u32_u64_u64 unique_0 2048 256 247.2±2.32µs 340.0±10.51µs 4.0 Ktx/sec 2.9 Ktx/sec
stdb_raw 🧠 u32_u64_str btree_each_column 2048 256 312.7±0.51µs 312.4±0.56µs 3.1 Ktx/sec 3.1 Ktx/sec
stdb_raw 🧠 u32_u64_str unique_0 2048 256 240.1±0.30µs 242.9±0.12µs 4.1 Ktx/sec 4.0 Ktx/sec
stdb_raw 🧠 u32_u64_u64 btree_each_column 2048 256 241.0±0.16µs 236.5±0.12µs 4.1 Ktx/sec 4.1 Ktx/sec
stdb_raw 🧠 u32_u64_u64 unique_0 2048 256 212.0±0.23µs 213.0±0.13µs 4.6 Ktx/sec 4.6 Ktx/sec

iterate

db on disk schema indices new latency old latency new throughput old throughput
sqlite 💿 u32_u64_str unique_0 21.0±0.21µs 21.4±0.13µs 46.4 Ktx/sec 45.6 Ktx/sec
sqlite 💿 u32_u64_u64 unique_0 19.6±0.28µs 19.3±0.07µs 49.8 Ktx/sec 50.5 Ktx/sec
sqlite 🧠 u32_u64_str unique_0 20.0±0.22µs 20.3±0.16µs 48.9 Ktx/sec 48.0 Ktx/sec
sqlite 🧠 u32_u64_u64 unique_0 18.6±0.27µs 18.3±0.04µs 52.5 Ktx/sec 53.3 Ktx/sec
stdb_raw 💿 u32_u64_str unique_0 3.8±0.00µs 4.8±0.00µs 255.8 Ktx/sec 202.7 Ktx/sec
stdb_raw 💿 u32_u64_u64 unique_0 3.7±0.00µs 4.7±0.00µs 262.2 Ktx/sec 206.9 Ktx/sec
stdb_raw 🧠 u32_u64_str unique_0 3.8±0.00µs 4.8±0.00µs 258.1 Ktx/sec 203.6 Ktx/sec
stdb_raw 🧠 u32_u64_u64 unique_0 3.7±0.00µs 4.7±0.00µs 264.8 Ktx/sec 208.3 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 65.6±0.17µs 66.7±0.18µs 14.9 Ktx/sec 14.6 Ktx/sec
sqlite 💿 u64 index 2048 256 63.6±0.14µs 63.3±0.30µs 15.4 Ktx/sec 15.4 Ktx/sec
sqlite 🧠 string index 2048 256 64.7±0.21µs 64.3±0.25µs 15.1 Ktx/sec 15.2 Ktx/sec
sqlite 🧠 u64 index 2048 256 59.4±0.18µs 59.0±0.15µs 16.4 Ktx/sec 16.5 Ktx/sec
stdb_raw 💿 string index 2048 256 5.2±0.00µs 5.1±0.00µs 189.4 Ktx/sec 189.8 Ktx/sec
stdb_raw 💿 u64 index 2048 256 5.1±0.00µs 5.1±0.00µs 192.3 Ktx/sec 192.3 Ktx/sec
stdb_raw 🧠 string index 2048 256 5.1±0.00µs 5.1±0.00µs 190.3 Ktx/sec 190.9 Ktx/sec
stdb_raw 🧠 u64 index 2048 256 5.0±0.00µs 5.1±0.00µs 193.4 Ktx/sec 193.4 Ktx/sec

serialize

schema format count new latency old latency new throughput old throughput
u32_u64_str bflatn_to_bsatn_fast_path 100 3.7±0.06µs 3.7±0.00µs 25.7 Mtx/sec 25.8 Mtx/sec
u32_u64_str bflatn_to_bsatn_slow_path 100 3.5±0.01µs 3.5±0.00µs 27.4 Mtx/sec 27.4 Mtx/sec
u32_u64_str bsatn 100 2.3±0.02µs 2.4±0.01µs 41.1 Mtx/sec 40.4 Mtx/sec
u32_u64_str json 100 4.9±0.06µs 5.1±0.04µs 19.4 Mtx/sec 18.8 Mtx/sec
u32_u64_str product_value 100 1015.5±0.70ns 1015.3±0.55ns 93.9 Mtx/sec 93.9 Mtx/sec
u32_u64_u64 bflatn_to_bsatn_fast_path 100 1102.7±45.70ns 1108.0±23.09ns 86.5 Mtx/sec 86.1 Mtx/sec
u32_u64_u64 bflatn_to_bsatn_slow_path 100 2.9±0.04µs 2.9±0.00µs 32.8 Mtx/sec 33.0 Mtx/sec
u32_u64_u64 bsatn 100 1724.7±31.98ns 1647.7±3.90ns 55.3 Mtx/sec 57.9 Mtx/sec
u32_u64_u64 json 100 3.1±0.10µs 3.2±0.03µs 30.8 Mtx/sec 30.2 Mtx/sec
u32_u64_u64 product_value 100 1009.2±0.64ns 1008.5±0.60ns 94.5 Mtx/sec 94.6 Mtx/sec
u64_u64_u32 bflatn_to_bsatn_fast_path 100 898.4±5.53ns 889.4±3.92ns 106.1 Mtx/sec 107.2 Mtx/sec
u64_u64_u32 bflatn_to_bsatn_slow_path 100 2.9±0.01µs 2.9±0.00µs 32.5 Mtx/sec 33.0 Mtx/sec
u64_u64_u32 bsatn 100 1736.7±32.27ns 1648.8±31.73ns 54.9 Mtx/sec 57.8 Mtx/sec
u64_u64_u32 json 100 3.2±0.04µs 3.1±0.01µs 29.6 Mtx/sec 31.1 Mtx/sec
u64_u64_u32 product_value 100 1010.8±0.31ns 1010.6±0.46ns 94.4 Mtx/sec 94.4 Mtx/sec

stdb_module_large_arguments

arg size new latency old latency new throughput old throughput
64KiB 85.4±8.89µs 89.3±6.34µs - -

stdb_module_print_bulk

line count new latency old latency new throughput old throughput
1 46.0±7.07µs 40.5±5.91µs - -
100 349.5±4.63µs 349.0±7.83µs - -
1000 2.5±0.50ms 2.9±0.26ms - -

remaining

name new latency old latency new throughput old throughput
sqlite/💿/update_bulk/u32_u64_str/unique_0/load=2048/count=256 49.0±0.35µs 48.2±0.41µs 19.9 Ktx/sec 20.3 Ktx/sec
sqlite/💿/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 41.7±0.42µs 43.8±8.88µs 23.4 Ktx/sec 22.3 Ktx/sec
sqlite/🧠/update_bulk/u32_u64_str/unique_0/load=2048/count=256 41.5±0.47µs 41.1±0.04µs 23.5 Ktx/sec 23.7 Ktx/sec
sqlite/🧠/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 37.0±0.14µs 35.3±0.06µs 26.4 Ktx/sec 27.7 Ktx/sec
stdb_module/💿/update_bulk/u32_u64_str/unique_0/load=2048/count=256 1268.9±19.30µs 1272.7±18.63µs 788 tx/sec 785 tx/sec
stdb_module/💿/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 965.7±6.83µs 954.7±12.40µs 1035 tx/sec 1047 tx/sec
stdb_raw/💿/update_bulk/u32_u64_str/unique_0/load=2048/count=256 615.2±37.69µs 552.7±23.11µs 1625 tx/sec 1809 tx/sec
stdb_raw/💿/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 481.3±8.63µs 497.1±16.60µs 2.0 Ktx/sec 2011 tx/sec
stdb_raw/🧠/update_bulk/u32_u64_str/unique_0/load=2048/count=256 375.1±0.39µs 387.5±0.37µs 2.6 Ktx/sec 2.5 Ktx/sec
stdb_raw/🧠/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 334.8±0.16µs 346.3±0.30µs 2.9 Ktx/sec 2.8 Ktx/sec

@github-actions
Copy link

@github-actions github-actions bot commented on be9c958 Jun 3, 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 6065 6079 -0.23% 6919 6943 -0.35%
sqlite 5676 5676 0.00% 6148 6084 1.05%

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 79545 79527 0.02% 79973 79919 0.07%
stdb_raw u32_u64_str no_index 64 128 2 string 121832 121814 0.01% 122602 122452 0.12%
stdb_raw u32_u64_str btree_each_column 64 128 1 u64 24290 24312 -0.09% 24590 24540 0.20%
stdb_raw u32_u64_str btree_each_column 64 128 2 string 25328 25351 -0.09% 25794 25673 0.47%
sqlite u32_u64_str no_index 64 128 2 string 143669 143669 0.00% 145123 145345 -0.15%
sqlite u32_u64_str no_index 64 128 1 u64 123010 123010 0.00% 124198 124428 -0.18%
sqlite u32_u64_str btree_each_column 64 128 2 string 133532 133532 0.00% 135196 135302 -0.08%
sqlite u32_u64_str btree_each_column 64 128 1 u64 130327 130327 0.00% 131877 131927 -0.04%

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 880932 879565 0.16% 927652 925491 0.23%
stdb_raw u32_u64_str btree_each_column 64 128 1010733 1009455 0.13% 1035141 1034995 0.01%
sqlite u32_u64_str unique_0 64 128 398429 398423 0.00% 417767 417667 0.02%
sqlite u32_u64_str btree_each_column 64 128 971496 971496 0.00% 1010656 1017504 -0.67%

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 152196 152347 -0.10% 152304 152423 -0.08%
stdb_raw u32_u64_str unique_0 64 16179 16330 -0.92% 16287 16402 -0.70%
sqlite u32_u64_str unique_0 1024 1046901 1046895 0.00% 1050263 1050255 0.00%
sqlite u32_u64_str unique_0 64 75047 75041 0.01% 76217 76169 0.06%

callgrind: serialize_product_value

count format total reads + writes old total reads + writes Δrw estimated cycles old estimated cycles Δcycles
64 json 47438 47438 0.00% 50158 50124 0.07%
64 bsatn 25717 25717 0.00% 27961 27961 0.00%
16 bsatn 8118 8118 0.00% 9444 9444 0.00%
16 json 12142 12142 0.00% 14148 14114 0.24%

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 20312008 20276251 0.18% 20848048 20810763 0.18%
stdb_raw u32_u64_str unique_0 64 128 1305855 1304074 0.14% 1376243 1374626 0.12%
sqlite u32_u64_str unique_0 1024 1024 1802045 1802096 -0.00% 1811705 1811300 0.02%
sqlite u32_u64_str unique_0 64 128 128575 128626 -0.04% 131329 131364 -0.03%
On-disk benchmarks

callgrind: empty transaction

db total reads + writes old total reads + writes Δrw estimated cycles old estimated cycles Δcycles
stdb_raw 6430 6444 -0.22% 7292 7306 -0.19%
sqlite 5718 5718 0.00% 6216 6160 0.91%

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 79910 79892 0.02% 80378 80396 -0.02%
stdb_raw u32_u64_str no_index 64 128 2 string 122176 122158 0.01% 122990 123072 -0.07%
stdb_raw u32_u64_str btree_each_column 64 128 1 u64 24655 24677 -0.09% 24975 25017 -0.17%
stdb_raw u32_u64_str btree_each_column 64 128 2 string 25695 25715 -0.08% 26217 26053 0.63%
sqlite u32_u64_str no_index 64 128 1 u64 124931 124931 0.00% 126491 126573 -0.06%
sqlite u32_u64_str no_index 64 128 2 string 145590 145590 0.00% 147364 147462 -0.07%
sqlite u32_u64_str btree_each_column 64 128 1 u64 132423 132423 0.00% 134279 134345 -0.05%
sqlite u32_u64_str btree_each_column 64 128 2 string 135582 135582 0.00% 137676 137686 -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 831692 829878 0.22% 846430 843874 0.30%
stdb_raw u32_u64_str btree_each_column 64 128 959540 957266 0.24% 982826 981466 0.14%
sqlite u32_u64_str unique_0 64 128 415971 415971 0.00% 434809 434579 0.05%
sqlite u32_u64_str btree_each_column 64 128 1022071 1022071 0.00% 1059389 1066851 -0.70%

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 152561 152712 -0.10% 152697 152780 -0.05%
stdb_raw u32_u64_str unique_0 64 16544 16695 -0.90% 16680 16763 -0.50%
sqlite u32_u64_str unique_0 1024 1049963 1049963 0.00% 1053695 1053699 -0.00%
sqlite u32_u64_str unique_0 64 76813 76813 0.00% 78137 78081 0.07%

callgrind: serialize_product_value

count format total reads + writes old total reads + writes Δrw estimated cycles old estimated cycles Δcycles
64 json 47438 47438 0.00% 50158 50124 0.07%
64 bsatn 25717 25717 0.00% 27961 27961 0.00%
16 bsatn 8118 8118 0.00% 9444 9444 0.00%
16 json 12142 12142 0.00% 14148 14114 0.24%

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 19260437 19230430 0.16% 19881123 19847632 0.17%
stdb_raw u32_u64_str unique_0 64 128 1249690 1247812 0.15% 1287940 1285868 0.16%
sqlite u32_u64_str unique_0 1024 1024 1809835 1809886 -0.00% 1818575 1818534 0.00%
sqlite u32_u64_str unique_0 64 128 132723 132774 -0.04% 135809 135768 0.03%

Please sign in to comment.