Skip to content

Commit

Permalink
Rust SDK: Actual client-side indices for unique constraints (#1909)
Browse files Browse the repository at this point in the history
  • Loading branch information
gefjon authored Nov 29, 2024
1 parent 1992b8e commit 80dff96
Show file tree
Hide file tree
Showing 378 changed files with 3,771 additions and 3,388 deletions.
43 changes: 0 additions & 43 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ http = "1.0"
humantime = "2.1.0"
hyper = "1.0"
hyper-util = { version = "0.1", features = ["tokio"] }
im = "15.1"
imara-diff = "0.1.3"
indexmap = "2.0.0"
indicatif = "0.16"
Expand Down
Loading

2 comments on commit 80dff96

@github-actions
Copy link

@github-actions github-actions bot commented on 80dff96 Nov 29, 2024

Choose a reason for hiding this comment

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

Benchmarking failed. Please check the workflow run for details.

@github-actions
Copy link

@github-actions github-actions bot commented on 80dff96 Nov 29, 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 6432 6432 0.00% 6540 6540 0.00%
sqlite 5609 5609 0.00% 6073 6073 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 74706 74706 0.00% 75138 75138 0.00%
stdb_raw u32_u64_str no_index 64 128 2 string 116948 116932 0.01% 117590 117590 0.00%
stdb_raw u32_u64_str btree_each_column 64 128 2 string 25116 25118 -0.01% 25634 25632 0.01%
stdb_raw u32_u64_str btree_each_column 64 128 1 u64 24084 24084 0.00% 24544 24544 0.00%
sqlite u32_u64_str no_index 64 128 2 string 144415 144433 -0.01% 145831 145885 -0.04%
sqlite u32_u64_str no_index 64 128 1 u64 123763 123763 0.00% 125029 125025 0.00%
sqlite u32_u64_str btree_each_column 64 128 1 u64 131113 131080 0.03% 132571 132526 0.03%
sqlite u32_u64_str btree_each_column 64 128 2 string 134222 134222 0.00% 135822 135822 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 881006 879154 0.21% 935734 902792 3.65%
stdb_raw u32_u64_str btree_each_column 64 128 1033086 1029887 0.31% 1057652 1054279 0.32%
sqlite u32_u64_str unique_0 64 128 399360 399360 0.00% 418734 418726 0.00%
sqlite u32_u64_str btree_each_column 64 128 984611 984611 0.00% 1018529 1018541 -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 138485 138485 0.00% 138559 138559 0.00%
stdb_raw u32_u64_str unique_0 64 15910 15910 0.00% 15972 15976 -0.03%
sqlite u32_u64_str unique_0 1024 1042718 1042718 0.00% 1046054 1046054 0.00%
sqlite u32_u64_str unique_0 64 74704 74704 0.00% 75782 75782 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% 50180 50180 0.00%
64 bsatn 25509 25509 0.00% 27719 27719 0.00%
16 bsatn 8200 8200 0.00% 9560 9560 0.00%
16 json 12188 12188 0.00% 14092 14092 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 20571891 20570562 0.01% 21253947 21252578 0.01%
stdb_raw u32_u64_str unique_0 64 128 1289401 1288954 0.03% 1367039 1366568 0.03%
sqlite u32_u64_str unique_0 1024 1024 1802137 1802137 0.00% 1811313 1811317 -0.00%
sqlite u32_u64_str unique_0 64 128 128540 128540 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 6437 6437 0.00% 6541 6541 0.00%
sqlite 5651 5651 0.00% 6141 6141 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 74711 74711 0.00% 75127 75107 0.03%
stdb_raw u32_u64_str no_index 64 128 2 string 116974 116953 0.02% 117520 117639 -0.10%
stdb_raw u32_u64_str btree_each_column 64 128 2 string 25122 25121 0.00% 25620 25607 0.05%
stdb_raw u32_u64_str btree_each_column 64 128 1 u64 24089 24089 0.00% 24537 24545 -0.03%
sqlite u32_u64_str no_index 64 128 1 u64 125684 125684 0.00% 127278 127278 0.00%
sqlite u32_u64_str no_index 64 128 2 string 146336 146336 0.00% 148128 148136 -0.01%
sqlite u32_u64_str btree_each_column 64 128 2 string 136418 136418 0.00% 138398 138398 0.00%
sqlite u32_u64_str btree_each_column 64 128 1 u64 133176 133176 0.00% 134958 134958 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 829601 828670 0.11% 883459 851564 3.75%
stdb_raw u32_u64_str btree_each_column 64 128 975974 977686 -0.18% 999630 1032010 -3.14%
sqlite u32_u64_str unique_0 64 128 416914 416914 0.00% 435856 435848 0.00%
sqlite u32_u64_str btree_each_column 64 128 1023158 1023158 0.00% 1056174 1056170 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 138490 138474 0.01% 138576 138536 0.03%
stdb_raw u32_u64_str unique_0 64 15915 15915 0.00% 15977 15977 0.00%
sqlite u32_u64_str unique_0 1024 1045796 1045796 0.00% 1049672 1049672 0.00%
sqlite u32_u64_str unique_0 64 76486 76486 0.00% 77848 77848 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% 50180 50180 0.00%
64 bsatn 25509 25509 0.00% 27719 27719 0.00%
16 bsatn 8200 8200 0.00% 9560 9560 0.00%
16 json 12188 12188 0.00% 14092 14092 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 19057820 19056703 0.01% 19812746 19812463 0.00%
stdb_raw u32_u64_str unique_0 64 128 1242001 1241863 0.01% 1319865 1319119 0.06%
sqlite u32_u64_str unique_0 1024 1024 1809785 1809785 0.00% 1818457 1818461 -0.00%
sqlite u32_u64_str unique_0 64 128 132687 132693 -0.00% 135783 135789 -0.00%

Please sign in to comment.