Skip to content

Commit

Permalink
test(1099): Multi-column index selection through query macro (#1001)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshua-spacetime committed Mar 21, 2024
1 parent fb932b6 commit 47e7878
Show file tree
Hide file tree
Showing 9 changed files with 178 additions and 9 deletions.
8 changes: 8 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ members = [
"crates/testing",
"crates/vm",
"modules/benchmarks",
"modules/perf-test",
"modules/rust-wasm-test",
"modules/quickstart-chat",
"modules/sdk-test",
Expand Down Expand Up @@ -63,6 +64,10 @@ rpath = false
[profile.bench]
debug = true

[profile.test]
opt-level = 1
debug = true

[profile.profiling]
inherits = "release"
debug = true
Expand Down
11 changes: 3 additions & 8 deletions crates/table/src/pointer_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,19 @@ static_assert_size!(PointerMap, 80);
// These are only used as sanity checks in the debug profile, and e.g., in tests.
#[cfg(debug_assertions)]
impl PointerMap {
#[allow(unused)]
fn maintains_invariants(&self) -> bool {
self.maintains_map_invariant() && self.maintains_colliders_invariant()
}

#[allow(unused)]
fn maintains_colliders_invariant(&self) -> bool {
self.colliders.iter().enumerate().all(|(idx, slot)| {
slot.len() >= 2 || slot.is_empty() && self.emptied_collider_slots.contains(&ColliderSlotIndex::new(idx))
})
}

#[allow(unused)]
fn maintains_map_invariant(&self) -> bool {
self.map.values().all(|poc| {
let collider = poc.as_collider();
Expand Down Expand Up @@ -234,8 +237,6 @@ impl PointerMap {
///
/// Handles any hash conflicts for `hash`.
pub fn insert(&mut self, hash: RowHash, ptr: RowPointer) -> bool {
debug_assert!(self.maintains_invariants());

let mut was_in_map = false;

self.map
Expand Down Expand Up @@ -291,17 +292,13 @@ impl PointerMap {
// 0 hashes so far.
.or_insert(PtrOrCollider::ptr(ptr));

debug_assert!(self.maintains_invariants());

was_in_map
}

/// Removes the association `hash -> ptr`.
///
/// Returns whether the association was deleted.
pub fn remove(&mut self, hash: RowHash, ptr: RowPointer) -> bool {
debug_assert!(self.maintains_invariants());

let ret = 'fun: {
let Entry::Occupied(mut entry) = self.map.entry(hash) else {
break 'fun false;
Expand Down Expand Up @@ -335,8 +332,6 @@ impl PointerMap {
true
};

debug_assert!(self.maintains_invariants());

ret
}
}
Expand Down
6 changes: 6 additions & 0 deletions crates/testing/src/modules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,12 @@ pub static DEFAULT_CONFIG: Config = Config {
fsync: FsyncPolicy::Never,
};

/// For performance tests, do not persist to disk.
pub static IN_MEMORY_CONFIG: Config = Config {
storage: Storage::Disk,
fsync: FsyncPolicy::Never,
};

/// Used to parse output from module logs.
///
/// Sync with: `core::database_logger::Record`. We can't use it
Expand Down
43 changes: 42 additions & 1 deletion crates/testing/tests/standalone_integration_test.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use serial_test::serial;
use spacetimedb_testing::modules::{
CompilationMode, CompiledModule, LogLevel, LoggerRecord, ModuleHandle, DEFAULT_CONFIG,
CompilationMode, CompiledModule, LogLevel, LoggerRecord, ModuleHandle, DEFAULT_CONFIG, IN_MEMORY_CONFIG,
};

fn init() {
Expand Down Expand Up @@ -139,3 +139,44 @@ fn test_call_query_macro() {
},
);
}

#[test]
#[serial]
/// This test runs the index scan workloads in the `perf-test` module.
/// Timing spans should be < 1ms if the correct index was used.
/// Otherwise these workloads will degenerate into full table scans.
fn test_index_scans() {
init();
CompiledModule::compile("perf-test", CompilationMode::Release).with_module_async(
IN_MEMORY_CONFIG,
|module| async move {
let json = r#"{"call": {"fn": "load_location_table", "args": []}}"#;
module.send(json.to_string()).await.unwrap();

let json = r#"{"call": {"fn": "test_index_scan_on_id", "args": []}}"#;
module.send(json.to_string()).await.unwrap();

let json = r#"{"call": {"fn": "test_index_scan_on_chunk", "args": []}}"#;
module.send(json.to_string()).await.unwrap();

let json = r#"{"call": {"fn": "test_index_scan_on_x_z_dimension", "args": []}}"#;
module.send(json.to_string()).await.unwrap();

// TODO(1011): Uncomment once multi-column prefix scans are supported
// let json = r#"{"call": {"fn": "test_index_scan_on_x_z", "args": []}}"#;
// module.send(json.to_string()).await.unwrap();

let logs = read_logs(&module).await;

// Each timing span should be < 1ms
let timing = |line: &str| {
line.starts_with("Timing span")
&& (line.ends_with("ns") || line.ends_with("us") || line.ends_with("µs"))
};
assert!(timing(&logs[0]));
assert!(timing(&logs[1]));
assert!(timing(&logs[2]));
// assert!(timing(&logs[3]));
},
);
}
17 changes: 17 additions & 0 deletions modules/perf-test/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Cargo
# will have compiled files and executables
debug/
target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

# Spacetime ignore
/.spacetime
13 changes: 13 additions & 0 deletions modules/perf-test/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[package]
name = "perf-test-module"
version = "0.1.0"
edition.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[lib]
crate-type = ["cdylib"]

[dependencies]
spacetimedb = { path = "../../crates/bindings" }
log.workspace = true
4 changes: 4 additions & 0 deletions modules/perf-test/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# `perf-test`

A module with various performance workloads for SpacetimeDB,
called from the `testing` crate.
80 changes: 80 additions & 0 deletions modules/perf-test/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
use spacetimedb::{query, spacetimedb, time_span::Span};

#[spacetimedb(table)]
#[spacetimedb(index(btree, name = "x", x))]
#[spacetimedb(index(btree, name = "chunk", chunk))]
#[spacetimedb(index(btree, name = "coordinates", x, z, dimension))]
#[derive(Debug, PartialEq, Eq)]
pub struct Location {
#[primarykey]
pub id: u64,
pub chunk: u64,
pub x: i32,
pub z: i32,
pub dimension: u32,
}

// 1000 chunks, 1200 rows per chunk = 1.2M rows
const NUM_CHUNKS: u64 = 1000;
const ROWS_PER_CHUNK: u64 = 1200;

#[spacetimedb(reducer)]
pub fn load_location_table() {
for chunk in 0u64..NUM_CHUNKS {
for i in 0u64..ROWS_PER_CHUNK {
let id = chunk * 1200 + i;
let x = 0i32;
let z = chunk as i32;
let dimension = id as u32;
let _ = Location::insert(Location {
id,
chunk,
x,
z,
dimension,
});
}
}
}

const ID: u64 = 989_987;
const CHUNK: u64 = ID / ROWS_PER_CHUNK;

#[spacetimedb(reducer)]
/// Probing a single column index for a single row should be fast!
pub fn test_index_scan_on_id() {
let span = Span::start("Index scan on {id}");
let location = Location::filter_by_id(&ID).unwrap();
span.end();
assert_eq!(ID, location.id);
}

#[spacetimedb(reducer)]
/// Scanning a single column index for `ROWS_PER_CHUNK` rows should also be fast!
pub fn test_index_scan_on_chunk() {
let span = Span::start("Index scan on {chunk}");
let n = Location::filter_by_chunk(&CHUNK).count();
span.end();
assert_eq!(n as u64, ROWS_PER_CHUNK);
}

#[spacetimedb(reducer)]
/// Probing a multi-column index for a single row should be fast!
pub fn test_index_scan_on_x_z_dimension() {
let z = CHUNK as i32;
let dimension = ID as u32;
let span = Span::start("Index scan on {x, z, dimension}");
let n = query!(|r: Location| r.x == 0 && r.z == z && r.dimension == dimension).count();
span.end();
assert_eq!(n, 1);
}

#[spacetimedb(reducer)]
/// Probing a multi-column index for `ROWS_PER_CHUNK` rows should also be fast!
pub fn test_index_scan_on_x_z() {
let z = CHUNK as i32;
let span = Span::start("Index scan on {x, z}");
let n = query!(|r: Location| r.x == 0 && r.z == z).count();
span.end();
assert_eq!(n as u64, ROWS_PER_CHUNK);
}

2 comments on commit 47e7878

@github-actions
Copy link

@github-actions github-actions bot commented on 47e7878 Mar 21, 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 💿 435.0±1.61ns 427.6±3.27ns - -
sqlite 🧠 433.1±2.98ns 413.6±2.15ns - -
stdb_raw 💿 707.0±1.49ns 704.7±1.51ns - -
stdb_raw 🧠 679.3±2.13ns 669.1±1.68ns - -

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 528.2±42.51µs 515.7±0.54µs 1893 tx/sec 1939 tx/sec
sqlite 💿 u32_u64_str unique_0 2048 256 135.1±0.61µs 133.8±0.66µs 7.2 Ktx/sec 7.3 Ktx/sec
sqlite 💿 u32_u64_u64 btree_each_column 2048 256 419.9±1.14µs 430.8±27.30µs 2.3 Ktx/sec 2.3 Ktx/sec
sqlite 💿 u32_u64_u64 unique_0 2048 256 124.2±0.56µs 126.7±0.84µs 7.9 Ktx/sec 7.7 Ktx/sec
sqlite 🧠 u32_u64_str btree_each_column 2048 256 450.6±0.66µs 447.1±1.99µs 2.2 Ktx/sec 2.2 Ktx/sec
sqlite 🧠 u32_u64_str unique_0 2048 256 119.9±0.56µs 120.9±0.48µs 8.1 Ktx/sec 8.1 Ktx/sec
sqlite 🧠 u32_u64_u64 btree_each_column 2048 256 366.1±0.40µs 367.9±0.63µs 2.7 Ktx/sec 2.7 Ktx/sec
sqlite 🧠 u32_u64_u64 unique_0 2048 256 105.2±0.52µs 106.1±0.52µs 9.3 Ktx/sec 9.2 Ktx/sec
stdb_raw 💿 u32_u64_str btree_each_column 2048 256 715.1±0.51µs 713.2±1.05µs 1398 tx/sec 1402 tx/sec
stdb_raw 💿 u32_u64_str unique_0 2048 256 617.2±1.26µs 618.6±0.43µs 1620 tx/sec 1616 tx/sec
stdb_raw 💿 u32_u64_u64 btree_each_column 2048 256 420.2±0.77µs 418.2±0.33µs 2.3 Ktx/sec 2.3 Ktx/sec
stdb_raw 💿 u32_u64_u64 unique_0 2048 256 375.8±0.54µs 377.7±0.49µs 2.6 Ktx/sec 2.6 Ktx/sec
stdb_raw 🧠 u32_u64_str btree_each_column 2048 256 489.4±0.32µs 485.9±0.41µs 2043 tx/sec 2.0 Ktx/sec
stdb_raw 🧠 u32_u64_str unique_0 2048 256 398.9±0.90µs 397.4±0.52µs 2.4 Ktx/sec 2.5 Ktx/sec
stdb_raw 🧠 u32_u64_u64 btree_each_column 2048 256 314.9±0.57µs 314.3±0.24µs 3.1 Ktx/sec 3.1 Ktx/sec
stdb_raw 🧠 u32_u64_u64 unique_0 2048 256 279.9±0.10µs 278.4±0.20µs 3.5 Ktx/sec 3.5 Ktx/sec

iterate

db on disk schema indices new latency old latency new throughput old throughput
sqlite 💿 u32_u64_str unique_0 20.7±0.22µs 21.0±0.14µs 47.2 Ktx/sec 46.5 Ktx/sec
sqlite 💿 u32_u64_u64 unique_0 19.3±0.12µs 19.7±0.13µs 50.7 Ktx/sec 49.7 Ktx/sec
sqlite 🧠 u32_u64_str unique_0 19.8±0.11µs 19.7±0.27µs 49.3 Ktx/sec 49.7 Ktx/sec
sqlite 🧠 u32_u64_u64 unique_0 18.3±0.22µs 18.1±0.03µs 53.3 Ktx/sec 53.9 Ktx/sec
stdb_raw 💿 u32_u64_str unique_0 18.7±0.00µs 18.7±0.00µs 52.3 Ktx/sec 52.3 Ktx/sec
stdb_raw 💿 u32_u64_u64 unique_0 15.8±0.00µs 15.8±0.00µs 61.6 Ktx/sec 61.6 Ktx/sec
stdb_raw 🧠 u32_u64_str unique_0 18.6±0.01µs 18.6±0.00µs 52.4 Ktx/sec 52.4 Ktx/sec
stdb_raw 🧠 u32_u64_u64 unique_0 15.8±0.00µs 15.8±0.00µs 61.8 Ktx/sec 61.8 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.9±0.10µs 66.0±0.17µs 14.8 Ktx/sec 14.8 Ktx/sec
sqlite 💿 u64 index 2048 256 64.0±0.18µs 63.9±0.38µs 15.3 Ktx/sec 15.3 Ktx/sec
sqlite 🧠 string index 2048 256 64.4±0.10µs 64.2±0.21µs 15.2 Ktx/sec 15.2 Ktx/sec
sqlite 🧠 u64 index 2048 256 59.1±0.17µs 59.7±0.54µs 16.5 Ktx/sec 16.4 Ktx/sec
stdb_raw 💿 string index 2048 256 5.6±0.00µs 5.7±0.00µs 174.0 Ktx/sec 171.2 Ktx/sec
stdb_raw 💿 u64 index 2048 256 5.5±0.00µs 5.5±0.00µs 176.9 Ktx/sec 176.0 Ktx/sec
stdb_raw 🧠 string index 2048 256 5.6±0.00µs 5.7±0.00µs 175.0 Ktx/sec 172.2 Ktx/sec
stdb_raw 🧠 u64 index 2048 256 5.5±0.00µs 5.5±0.00µs 178.3 Ktx/sec 177.1 Ktx/sec

serialize

schema format count new latency old latency new throughput old throughput
u32_u64_str bsatn 100 2.4±0.01µs 2.4±0.00µs 39.8 Mtx/sec 39.8 Mtx/sec
u32_u64_str json 100 5.1±0.04µs 5.1±0.02µs 18.7 Mtx/sec 18.8 Mtx/sec
u32_u64_str product_value 100 674.7±7.93ns 674.4±0.46ns 141.3 Mtx/sec 141.4 Mtx/sec
u32_u64_u64 bsatn 100 1855.1±34.28ns 1736.1±32.11ns 51.4 Mtx/sec 54.9 Mtx/sec
u32_u64_u64 json 100 3.3±0.05µs 3.4±0.03µs 29.0 Mtx/sec 28.1 Mtx/sec
u32_u64_u64 product_value 100 598.9±0.77ns 599.0±0.47ns 159.2 Mtx/sec 159.2 Mtx/sec

stdb_module_large_arguments

arg size new latency old latency new throughput old throughput
64KiB 90.3±4.85µs 80.5±10.15µs - -

stdb_module_print_bulk

line count new latency old latency new throughput old throughput
1 44.3±4.83µs 42.0±4.21µs - -
100 341.3±17.47µs 337.6±5.26µs - -
1000 2.9±0.07ms 2.0±0.40ms - -

remaining

name new latency old latency new throughput old throughput
sqlite/💿/update_bulk/u32_u64_str/unique_0/load=2048/count=256 47.6±0.32µs 48.6±0.20µs 20.5 Ktx/sec 20.1 Ktx/sec
sqlite/💿/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 48.2±16.60µs 42.1±0.23µs 20.3 Ktx/sec 23.2 Ktx/sec
sqlite/🧠/update_bulk/u32_u64_str/unique_0/load=2048/count=256 41.3±0.24µs 42.0±0.14µs 23.6 Ktx/sec 23.3 Ktx/sec
sqlite/🧠/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 37.4±0.15µs 37.4±0.30µs 26.1 Ktx/sec 26.1 Ktx/sec
stdb_module/💿/update_bulk/u32_u64_str/unique_0/load=2048/count=256 2.9±0.01ms 3.0±0.07ms 343 tx/sec 332 tx/sec
stdb_module/💿/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 2.1±0.00ms 2.1±0.03ms 486 tx/sec 485 tx/sec
stdb_raw/💿/update_bulk/u32_u64_str/unique_0/load=2048/count=256 1107.3±3.22µs 1105.4±0.68µs 903 tx/sec 904 tx/sec
stdb_raw/💿/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 748.4±0.40µs 741.7±0.25µs 1336 tx/sec 1348 tx/sec
stdb_raw/🧠/update_bulk/u32_u64_str/unique_0/load=2048/count=256 781.1±0.24µs 778.7±0.49µs 1280 tx/sec 1284 tx/sec
stdb_raw/🧠/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 552.7±0.92µs 546.9±0.46µs 1809 tx/sec 1828 tx/sec

@github-actions
Copy link

@github-actions github-actions bot commented on 47e7878 Mar 21, 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 6118 6126 -0.13% 6940 6948 -0.12%
sqlite 5558 5558 0.00% 5980 5980 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 84042 84042 0.00% 84950 84950 0.00%
stdb_raw u32_u64_str no_index 64 128 2 string 126734 126734 0.00% 128162 128142 0.02%
stdb_raw u32_u64_str btree_each_column 64 128 2 string 29402 29404 -0.01% 30562 30576 -0.05%
stdb_raw u32_u64_str btree_each_column 64 128 1 u64 28359 28359 0.00% 29279 29291 -0.04%
sqlite u32_u64_str no_index 64 128 1 u64 122927 122927 0.00% 124231 124223 0.01%
sqlite u32_u64_str no_index 64 128 2 string 143573 143573 0.00% 145177 145165 0.01%
sqlite u32_u64_str btree_each_column 64 128 2 string 133436 133436 0.00% 135242 135242 0.00%
sqlite u32_u64_str btree_each_column 64 128 1 u64 130244 130244 0.00% 131916 131916 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 1454746 1454977 -0.02% 1509176 1509401 -0.01%
stdb_raw u32_u64_str btree_each_column 64 128 1600927 1601477 -0.03% 1659629 1660529 -0.05%
sqlite u32_u64_str unique_0 64 128 396335 396335 0.00% 412955 412975 -0.00%
sqlite u32_u64_str btree_each_column 64 128 981657 981657 0.00% 1014875 1014875 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 179148 179148 0.00% 179532 179532 0.00%
stdb_raw u32_u64_str unique_0 64 18758 18758 0.00% 19066 19066 0.00%
sqlite u32_u64_str unique_0 1024 1044686 1044686 0.00% 1047846 1047842 0.00%
sqlite u32_u64_str unique_0 64 74746 74746 0.00% 75900 75900 0.00%

callgrind: serialize_product_value

count format total reads + writes old total reads + writes Δrw estimated cycles old estimated cycles Δcycles
64 json 50569 50569 0.00% 52783 52783 0.00%
64 bsatn 28951 28951 0.00% 31963 31963 0.00%
16 json 12643 12643 0.00% 14479 14479 0.00%
16 bsatn 8357 8357 0.00% 9717 9717 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 45837216 45837204 0.00% 47370254 47366376 0.01%
stdb_raw u32_u64_str unique_0 64 128 2693072 2693043 0.00% 2800250 2800251 -0.00%
sqlite u32_u64_str unique_0 1024 1024 1801964 1801964 0.00% 1811566 1811570 -0.00%
sqlite u32_u64_str unique_0 64 128 128478 128478 0.00% 131452 131452 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 6390 6406 -0.25% 7198 7214 -0.22%
sqlite 5600 5600 0.00% 6028 6028 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 84334 84334 0.00% 85350 85346 0.00%
stdb_raw u32_u64_str no_index 64 128 2 string 127026 127026 0.00% 128546 128510 0.03%
stdb_raw u32_u64_str btree_each_column 64 128 1 u64 28651 28651 0.00% 29631 29663 -0.11%
stdb_raw u32_u64_str btree_each_column 64 128 2 string 29709 29694 0.05% 30893 30858 0.11%
sqlite u32_u64_str no_index 64 128 1 u64 124848 124848 0.00% 126624 126620 0.00%
sqlite u32_u64_str no_index 64 128 2 string 145509 145494 0.01% 147493 147474 0.01%
sqlite u32_u64_str btree_each_column 64 128 2 string 135496 135496 0.00% 137604 137600 0.00%
sqlite u32_u64_str btree_each_column 64 128 1 u64 132350 132350 0.00% 134350 134354 -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 2262758 2262820 -0.00% 2320380 2320486 -0.00%
stdb_raw u32_u64_str btree_each_column 64 128 2417797 2414819 0.12% 2478303 2473849 0.18%
sqlite u32_u64_str unique_0 64 128 413847 413847 0.00% 430025 430017 0.00%
sqlite u32_u64_str btree_each_column 64 128 1019847 1019847 0.00% 1054205 1054205 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 179420 179420 0.00% 179860 179860 0.00%
stdb_raw u32_u64_str unique_0 64 19030 19030 0.00% 19366 19366 0.00%
sqlite u32_u64_str unique_0 1024 1047738 1047738 0.00% 1051594 1051594 0.00%
sqlite u32_u64_str unique_0 64 76508 76508 0.00% 77960 77960 0.00%

callgrind: serialize_product_value

count format total reads + writes old total reads + writes Δrw estimated cycles old estimated cycles Δcycles
64 json 50569 50569 0.00% 52783 52783 0.00%
64 bsatn 28951 28951 0.00% 31963 31963 0.00%
16 json 12643 12643 0.00% 14479 14479 0.00%
16 bsatn 8357 8357 0.00% 9717 9717 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 71212860 71212913 -0.00% 73185306 73186129 -0.00%
stdb_raw u32_u64_str unique_0 64 128 4125018 4124951 0.00% 4241284 4241205 0.00%
sqlite u32_u64_str unique_0 1024 1024 1809740 1809725 0.00% 1818642 1818619 0.00%
sqlite u32_u64_str unique_0 64 128 132626 132626 0.00% 135664 135664 0.00%

Please sign in to comment.