Skip to content

Commit

Permalink
Add test for light update (#1953)
Browse files Browse the repository at this point in the history
  • Loading branch information
Centril authored Nov 8, 2024
1 parent 4c0c755 commit e9e5a97
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 7 deletions.
103 changes: 96 additions & 7 deletions crates/sdk/tests/test-client/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
#[allow(clippy::large_enum_variant)]
mod module_bindings;

use core::fmt::Display;

use module_bindings::*;

use spacetimedb_sdk::{
credentials,
sats::{i256, u256},
Address, DbContext, Event, Identity, ReducerEvent, Status, Table,
ws_messages::CallReducerFlags,
Address, DbConnectionBuilder, DbContext, Event, Identity, ReducerEvent, Status, Table,
};
use test_counter::TestCounter;

Expand Down Expand Up @@ -90,6 +93,9 @@ fn main() {
"caller_always_notified" => exec_caller_always_notified(),

"subscribe_all_select_star" => exec_subscribe_all_select_star(),
"caller_alice_receives_reducer_callback_but_not_bob" => {
exec_caller_alice_receives_reducer_callback_but_not_bob()
}
_ => panic!("Unknown test: {}", test),
}
}
Expand Down Expand Up @@ -318,26 +324,34 @@ const SUBSCRIBE_ALL: &[&str] = &[
"SELECT * FROM table_holds_table;",
];

fn connect_then(
fn connect_with_then(
test_counter: &std::sync::Arc<TestCounter>,
on_connect_suffix: &str,
with_builder: impl FnOnce(DbConnectionBuilder<RemoteModule>) -> DbConnectionBuilder<RemoteModule>,
callback: impl FnOnce(&DbConnection) + Send + 'static,
) -> DbConnection {
let connected_result = test_counter.add_test("on_connect");
let connected_result = test_counter.add_test(format!("on_connect_{on_connect_suffix}"));
let name = db_name_or_panic();
let conn = DbConnection::builder()
let builder = DbConnection::builder()
.with_module_name(name)
.with_uri(LOCALHOST)
.on_connect(|ctx, _, _| {
callback(ctx);
connected_result(Ok(()));
})
.on_connect_error(|e| panic!("Connect errored: {e:?}"))
.build()
.unwrap();
.on_connect_error(|e| panic!("Connect errored: {e:?}"));
let conn = with_builder(builder).build().unwrap();
conn.run_threaded();
conn
}

fn connect_then(
test_counter: &std::sync::Arc<TestCounter>,
callback: impl FnOnce(&DbConnection) + Send + 'static,
) -> DbConnection {
connect_with_then(test_counter, "", |x| x, callback)
}

fn connect(test_counter: &std::sync::Arc<TestCounter>) -> DbConnection {
connect_then(test_counter, |_| {})
}
Expand Down Expand Up @@ -1594,3 +1608,78 @@ fn exec_subscribe_all_select_star() {

test_counter.wait_for_all();
}

fn exec_caller_alice_receives_reducer_callback_but_not_bob() {
fn check_val<T: Display + Eq>(val: T, eq: T) -> anyhow::Result<()> {
(val == eq)
.then_some(())
.ok_or_else(|| anyhow::anyhow!("wrong value received: `{val}`, expected: `{eq}`"))
}

// Have two actors, Alice (0) and Bob (1), connect to the module.
let connect_counter = TestCounter::new();
let actors = ["alice", "bob"];
let conns = actors.map(|who| connect_with_then(&connect_counter, who, |b| b.with_light_mode(true), |_| {}));
// Ensure both have finished connecting so that there isn't a race condition
// between Alice executing the reducer and Bob being connected.
connect_counter.wait_for_all();

let counter = TestCounter::new();
// For each actor, subscribe to the `OneU8` table.
// The choice of table is a fairly random one: just one of the simpler tables.
for (who, conn) in actors.into_iter().zip(conns.iter()) {
let sub_applied = counter.add_test(format!("sub_applied_{who}"));
let counter2 = counter.clone();
conn.subscription_builder()
.on_applied(move |ctx| {
sub_applied(Ok(()));
// Test that we are notified when a row is inserted.
let db = ctx.db();
let mut one_u8_inserted = Some(counter2.add_test(format!("one_u8_inserted_{who}")));
db.one_u_8().on_insert(move |_, row| {
(one_u8_inserted.take().unwrap())(check_val(row.n, 42));
});
let mut one_u16_inserted = Some(counter2.add_test(format!("one_u16_inserted_{who}")));
db.one_u_16().on_insert(move |event, row| {
let run_checks = || {
anyhow::ensure!(
matches!(event.event, Event::UnknownTransaction),
"reducer should be unknown",
);
check_val(row.n, 24)
};
(one_u16_inserted.take().unwrap())(run_checks());
});
})
.on_error(|_| panic!("Subscription error"))
.subscribe(["SELECT * FROM one_u8", "SELECT * FROM one_u16"]);
}

// Alice executes a reducer.
// This should cause a row callback to be received by Alice and Bob.
// A reducer callback should only be received by Alice.
let mut alice_gets_reducer_callback = Some(counter.add_test("gets_reducer_callback_alice"));
conns[0]
.reducers()
.on_insert_one_u_8(move |_, &val| (alice_gets_reducer_callback.take().unwrap())(check_val(val, 42)));
conns[1]
.reducers()
.on_insert_one_u_8(move |_, _| panic!("bob received reducer callback"));
conns[0].reducers().insert_one_u_8(42).unwrap();

// Alice executes a reducer but decides not to be notified about it, so they shouldn't.
conns[0]
.set_reducer_flags()
.insert_one_u_16(CallReducerFlags::NoSuccessNotify);
for conn in &conns {
conn.reducers()
.on_insert_one_u_16(move |_, _| panic!("received reducer callback"));
}
conns[0].reducers().insert_one_u_16(24).unwrap();

counter.wait_for_all();

// For the integrity of the test, ensure that Alice != Bob.
// We do this after `run_threaded` so that the ids have been filled.
assert_ne!(conns[0].identity(), conns[1].identity());
}
5 changes: 5 additions & 0 deletions crates/sdk/tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,11 @@ macro_rules! declare_tests_with_suffix {
fn subscribe_all_select_star() {
make_test("subscribe_all_select_star").run();
}

#[test]
fn caller_alice_receives_reducer_callback_but_not_bob() {
make_test("caller_alice_receives_reducer_callback_but_not_bob").run();
}
}
};
}
Expand Down

2 comments on commit e9e5a97

@github-actions
Copy link

@github-actions github-actions bot commented on e9e5a97 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 💿 421.2±4.72ns 429.2±3.53ns - -
sqlite 🧠 411.6±2.68ns 419.6±3.49ns - -
stdb_raw 💿 774.9±1.22ns 778.3±1.31ns - -
stdb_raw 🧠 774.2±1.02ns 778.1±3.69ns - -

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 586.9±0.86µs 593.9±2.69µs 1703 tx/sec 1683 tx/sec
sqlite 💿 u32_u64_str unique_0 2048 256 152.7±0.51µs 156.6±0.70µs 6.4 Ktx/sec 6.2 Ktx/sec
sqlite 💿 u32_u64_u64 btree_each_column 2048 256 472.4±0.65µs 477.7±0.70µs 2.1 Ktx/sec 2.0 Ktx/sec
sqlite 💿 u32_u64_u64 unique_0 2048 256 137.7±0.65µs 142.3±0.64µs 7.1 Ktx/sec 6.9 Ktx/sec
sqlite 🧠 u32_u64_str btree_each_column 2048 256 447.9±0.87µs 456.8±1.64µs 2.2 Ktx/sec 2.1 Ktx/sec
sqlite 🧠 u32_u64_str unique_0 2048 256 123.6±0.58µs 126.9±0.90µs 7.9 Ktx/sec 7.7 Ktx/sec
sqlite 🧠 u32_u64_u64 btree_each_column 2048 256 371.0±0.65µs 377.6±1.14µs 2.6 Ktx/sec 2.6 Ktx/sec
sqlite 🧠 u32_u64_u64 unique_0 2048 256 109.3±1.05µs 109.2±1.07µs 8.9 Ktx/sec 8.9 Ktx/sec
stdb_raw 💿 u32_u64_str btree_each_column 2048 256 596.7±23.27µs 575.3±64.44µs 1675 tx/sec 1738 tx/sec
stdb_raw 💿 u32_u64_str unique_0 2048 256 483.7±35.95µs 447.0±49.78µs 2.0 Ktx/sec 2.2 Ktx/sec
stdb_raw 💿 u32_u64_u64 btree_each_column 2048 256 320.2±10.39µs 380.4±7.63µs 3.0 Ktx/sec 2.6 Ktx/sec
stdb_raw 💿 u32_u64_u64 unique_0 2048 256 331.4±19.71µs 347.9±12.90µs 2.9 Ktx/sec 2.8 Ktx/sec
stdb_raw 🧠 u32_u64_str btree_each_column 2048 256 296.2±0.16µs 296.2±0.43µs 3.3 Ktx/sec 3.3 Ktx/sec
stdb_raw 🧠 u32_u64_str unique_0 2048 256 227.5±0.44µs 229.1±0.78µs 4.3 Ktx/sec 4.3 Ktx/sec
stdb_raw 🧠 u32_u64_u64 btree_each_column 2048 256 234.6±0.12µs 234.7±0.20µs 4.2 Ktx/sec 4.2 Ktx/sec
stdb_raw 🧠 u32_u64_u64 unique_0 2048 256 207.1±0.29µs 207.3±0.37µ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.9±0.02µs 26.0±0.06µs 40.8 Ktx/sec 37.6 Ktx/sec
sqlite 💿 u32_u64_u64 unique_0 21.0±0.28µs 22.2±0.09µs 46.5 Ktx/sec 44.1 Ktx/sec
sqlite 🧠 u32_u64_str unique_0 21.4±0.08µs 23.3±0.08µs 45.6 Ktx/sec 41.9 Ktx/sec
sqlite 🧠 u32_u64_u64 unique_0 18.3±0.03µs 19.7±0.27µs 53.3 Ktx/sec 49.5 Ktx/sec
stdb_raw 💿 u32_u64_str unique_0 4.9±0.00µs 4.9±0.00µs 200.4 Ktx/sec 200.1 Ktx/sec
stdb_raw 💿 u32_u64_u64 unique_0 4.8±0.00µs 4.8±0.00µs 204.4 Ktx/sec 204.2 Ktx/sec
stdb_raw 🧠 u32_u64_str unique_0 4.9±0.00µs 4.9±0.00µs 200.3 Ktx/sec 200.2 Ktx/sec
stdb_raw 🧠 u32_u64_u64 unique_0 4.8±0.00µs 4.8±0.00µs 204.5 Ktx/sec 204.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 67.6±0.11µs 70.9±0.18µs 14.5 Ktx/sec 13.8 Ktx/sec
sqlite 💿 u64 index 2048 256 63.1±0.27µs 64.9±0.33µs 15.5 Ktx/sec 15.0 Ktx/sec
sqlite 🧠 string index 2048 256 64.0±0.19µs 66.9±0.09µs 15.3 Ktx/sec 14.6 Ktx/sec
sqlite 🧠 u64 index 2048 256 57.4±0.11µs 58.7±0.21µs 17.0 Ktx/sec 16.6 Ktx/sec
stdb_raw 💿 string index 2048 256 5.2±0.01µs 5.1±0.00µs 188.7 Ktx/sec 192.7 Ktx/sec
stdb_raw 💿 u64 index 2048 256 5.1±0.00µs 5.0±0.00µs 192.8 Ktx/sec 195.7 Ktx/sec
stdb_raw 🧠 string index 2048 256 5.2±0.00µs 5.1±0.00µs 189.1 Ktx/sec 192.4 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

serialize

schema format count new latency old latency new throughput old throughput
u32_u64_str bflatn_to_bsatn_fast_path 100 3.6±0.00µs 3.6±0.01µs 26.5 Mtx/sec 26.4 Mtx/sec
u32_u64_str bflatn_to_bsatn_slow_path 100 3.6±0.02µs 3.6±0.01µs 26.6 Mtx/sec 26.6 Mtx/sec
u32_u64_str bsatn 100 15.5±0.10ns 15.5±0.16ns 6.0 Gtx/sec 6.0 Gtx/sec
u32_u64_str bsatn 100 2.4±0.01µs 2.4±0.02µs 39.5 Mtx/sec 39.5 Mtx/sec
u32_u64_str json 100 5.1±0.04µs 5.2±0.05µs 18.8 Mtx/sec 18.4 Mtx/sec
u32_u64_str json 100 8.2±0.05µs 8.4±0.05µs 11.7 Mtx/sec 11.4 Mtx/sec
u32_u64_str product_value 100 1018.6±0.96ns 1018.4±1.69ns 93.6 Mtx/sec 93.6 Mtx/sec
u32_u64_u64 bflatn_to_bsatn_fast_path 100 1006.1±11.65ns 1011.5±10.22ns 94.8 Mtx/sec 94.3 Mtx/sec
u32_u64_u64 bflatn_to_bsatn_slow_path 100 2.8±0.03µs 2.8±0.00µs 34.0 Mtx/sec 34.3 Mtx/sec
u32_u64_u64 bsatn 100 14.8±0.04ns 14.8±0.03ns 6.3 Gtx/sec 6.3 Gtx/sec
u32_u64_u64 bsatn 100 1734.0±21.74ns 1736.1±22.21ns 55.0 Mtx/sec 54.9 Mtx/sec
u32_u64_u64 json 100 3.1±0.04µs 3.3±0.02µs 30.4 Mtx/sec 28.7 Mtx/sec
u32_u64_u64 json 100 5.9±0.03µs 5.9±0.03µs 16.1 Mtx/sec 16.0 Mtx/sec
u32_u64_u64 product_value 100 1015.7±0.77ns 1015.9±1.52ns 93.9 Mtx/sec 93.9 Mtx/sec
u64_u64_u32 bflatn_to_bsatn_fast_path 100 758.3±5.27ns 759.3±0.73ns 125.8 Mtx/sec 125.6 Mtx/sec
u64_u64_u32 bflatn_to_bsatn_slow_path 100 2.8±0.01µs 2.8±0.04µs 34.1 Mtx/sec 34.2 Mtx/sec
u64_u64_u32 bsatn 100 1740.4±23.82ns 1743.1±22.20ns 54.8 Mtx/sec 54.7 Mtx/sec
u64_u64_u32 bsatn 100 705.4±0.84ns 704.5±0.66ns 135.2 Mtx/sec 135.4 Mtx/sec
u64_u64_u32 json 100 3.2±0.04µs 3.2±0.02µs 30.0 Mtx/sec 30.1 Mtx/sec
u64_u64_u32 json 100 5.9±0.04µs 5.9±0.01µs 16.3 Mtx/sec 16.1 Mtx/sec
u64_u64_u32 product_value 100 1014.1±0.59ns 1014.7±1.07ns 94.0 Mtx/sec 94.0 Mtx/sec

stdb_module_large_arguments

arg size new latency old latency new throughput old throughput
64KiB 104.6±6.28µs 104.2±6.90µs - -

stdb_module_print_bulk

line count new latency old latency new throughput old throughput
1 56.5±5.19µs 56.6±4.61µs - -
100 602.3±4.61µs 597.2±8.27µs - -
1000 5.4±0.03ms 5.2±0.49ms - -

remaining

name new latency old latency new throughput old throughput
special/db_game/circles/load=10 53.0±1.29ms 52.9±2.03ms - -
special/db_game/circles/load=100 38.5±2.71ms 52.2±4.50ms - -
special/db_game/ia_loop/load=500 150.6±1.07ms 146.4±1.42ms - -
special/db_game/ia_loop/load=5000 5.3±0.03s 5.3±0.03s - -
sqlite/💿/update_bulk/u32_u64_str/unique_0/load=2048/count=256 53.7±0.28µs 57.4±0.17µs 18.2 Ktx/sec 17.0 Ktx/sec
sqlite/💿/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 46.1±0.11µs 48.4±0.20µs 21.2 Ktx/sec 20.2 Ktx/sec
sqlite/🧠/update_bulk/u32_u64_str/unique_0/load=2048/count=256 39.1±0.24µs 42.8±0.24µs 25.0 Ktx/sec 22.8 Ktx/sec
sqlite/🧠/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 34.9±0.18µs 37.3±0.05µs 28.0 Ktx/sec 26.2 Ktx/sec
stdb_module/💿/update_bulk/u32_u64_str/unique_0/load=2048/count=256 1268.4±12.89µs 1253.4±21.84µs 788 tx/sec 797 tx/sec
stdb_module/💿/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 1009.6±7.88µs 1006.9±6.83µs 990 tx/sec 993 tx/sec
stdb_raw/💿/update_bulk/u32_u64_str/unique_0/load=2048/count=256 622.0±16.94µs 529.1±15.37µs 1607 tx/sec 1890 tx/sec
stdb_raw/💿/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 415.2±11.69µs 482.0±7.98µs 2.4 Ktx/sec 2.0 Ktx/sec
stdb_raw/🧠/update_bulk/u32_u64_str/unique_0/load=2048/count=256 360.6±0.20µs 363.6±0.39µs 2.7 Ktx/sec 2.7 Ktx/sec
stdb_raw/🧠/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 326.7±0.20µs 325.9±0.17µs 3.0 Ktx/sec 3.0 Ktx/sec

@github-actions
Copy link

@github-actions github-actions bot commented on e9e5a97 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% 76981 76993 -0.02%
stdb_raw u32_u64_str no_index 64 128 2 string 119091 120180 -0.91% 119779 120792 -0.84%
stdb_raw u32_u64_str btree_each_column 64 128 2 string 25083 25083 0.00% 25627 25615 0.05%
stdb_raw u32_u64_str btree_each_column 64 128 1 u64 24051 24051 0.00% 24451 24423 0.11%
sqlite u32_u64_str no_index 64 128 2 string 144695 144695 0.00% 146261 146261 0.00%
sqlite u32_u64_str no_index 64 128 1 u64 124044 124044 0.00% 125338 125334 0.00%
sqlite u32_u64_str btree_each_column 64 128 1 u64 131361 131361 0.00% 132811 132807 0.00%
sqlite u32_u64_str btree_each_column 64 128 2 string 134494 134494 0.00% 136100 136100 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 875757 877162 -0.16% 899593 931834 -3.46%
stdb_raw u32_u64_str btree_each_column 64 128 1023785 1023972 -0.02% 1064997 1065492 -0.05%
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% 1020529 1020517 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 1067273 1067255 0.00% 1070681 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 20084936 20490139 -1.98% 20662240 21131437 -2.22%
stdb_raw u32_u64_str unique_0 64 128 1284386 1284775 -0.03% 1359554 1327581 2.41%
sqlite u32_u64_str unique_0 1024 1024 1802182 1802200 -0.00% 1811362 1811384 -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% 76982 76978 0.01%
stdb_raw u32_u64_str no_index 64 128 2 string 119096 119096 0.00% 119820 119756 0.05%
stdb_raw u32_u64_str btree_each_column 64 128 2 string 25088 25089 -0.00% 25572 25577 -0.02%
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 127543 0.00%
sqlite u32_u64_str no_index 64 128 2 string 146616 146616 0.00% 148446 148454 -0.01%
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 133463 -0.00% 135341 135347 -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 827011 826115 0.11% 880749 879949 0.09%
stdb_raw u32_u64_str btree_each_column 64 128 974099 977599 -0.36% 1044871 1048121 -0.31%
sqlite u32_u64_str unique_0 64 128 415857 415857 0.00% 431875 431867 0.00%
sqlite u32_u64_str btree_each_column 64 128 1021898 1021898 0.00% 1057614 1057602 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 1070341 -0.00% 1074097 1074115 -0.00%
sqlite u32_u64_str unique_0 64 77973 78006 -0.04% 79303 79336 -0.04%

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 19002577 19003809 -0.01% 19644985 19643755 0.01%
stdb_raw u32_u64_str unique_0 64 128 1237396 1238098 -0.06% 1309094 1309282 -0.01%
sqlite u32_u64_str unique_0 1024 1024 1809761 1809743 0.00% 1818485 1818455 0.00%
sqlite u32_u64_str unique_0 64 128 132654 132654 0.00% 135834 135834 0.00%

Please sign in to comment.