Skip to content

Commit

Permalink
Get jsonwebtoken and jwks forks from crates.io (#1958)
Browse files Browse the repository at this point in the history
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
bfops and bfops authored Nov 7, 2024

Verified

This commit was signed with the committer’s verified signature. The key has expired.
orbitalturtle Alyssa Hertig
1 parent 97c8c26 commit adf6dab
Showing 3 changed files with 36 additions and 34 deletions.
66 changes: 34 additions & 32 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -173,7 +173,7 @@ indicatif = "0.16"
insta = { version = "1.21.0", features = ["toml"] }
is-terminal = "0.4"
itertools = "0.12"
jsonwebtoken = { git = "https://github.com/jsdt/jsonwebtoken.git", rev = "7f0cef63c74f58dfa912e88da844932ba4c71562"}
jsonwebtoken = { package = "spacetimedb-jsonwebtoken", version = "9.3.0" }
lazy_static = "1.4.0"
log = "0.4.17"
mimalloc = "0.1.39"
2 changes: 1 addition & 1 deletion crates/core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -101,7 +101,7 @@ url.workspace = true
urlencoding.workspace = true
uuid.workspace = true
wasmtime.workspace = true
jwks = { git = "https://github.com/jsdt/jwks.git", rev = "acb4241f3768ff89515a0c12d927e280a604fff3"}
jwks = { package = "spacetimedb-jwks", version = "0.1.3" }
async_cache = "0.3.1"
faststr = "0.2.23"

2 comments on commit adf6dab

@github-actions
Copy link

@github-actions github-actions bot commented on adf6dab Nov 7, 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 💿 413.2±1.32ns 406.5±3.89ns - -
sqlite 🧠 408.4±1.45ns 399.3±3.89ns - -
stdb_raw 💿 774.6±3.68ns 782.4±0.57ns - -
stdb_raw 🧠 775.2±1.01ns 783.6±1.26ns - -

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 589.2±0.86µs 582.2±0.78µs 1697 tx/sec 1717 tx/sec
sqlite 💿 u32_u64_str unique_0 2048 256 150.9±0.45µs 150.3±0.92µs 6.5 Ktx/sec 6.5 Ktx/sec
sqlite 💿 u32_u64_u64 btree_each_column 2048 256 479.6±28.08µs 459.3±0.91µs 2.0 Ktx/sec 2.1 Ktx/sec
sqlite 💿 u32_u64_u64 unique_0 2048 256 140.8±0.31µs 137.4±12.01µs 6.9 Ktx/sec 7.1 Ktx/sec
sqlite 🧠 u32_u64_str btree_each_column 2048 256 451.6±1.11µs 439.9±0.75µs 2.2 Ktx/sec 2.2 Ktx/sec
sqlite 🧠 u32_u64_str unique_0 2048 256 127.9±0.96µs 121.5±0.31µs 7.6 Ktx/sec 8.0 Ktx/sec
sqlite 🧠 u32_u64_u64 btree_each_column 2048 256 370.4±0.47µs 359.5±1.12µs 2.6 Ktx/sec 2.7 Ktx/sec
sqlite 🧠 u32_u64_u64 unique_0 2048 256 109.0±0.77µs 103.3±0.89µs 9.0 Ktx/sec 9.5 Ktx/sec
stdb_raw 💿 u32_u64_str btree_each_column 2048 256 597.0±14.18µs 593.9±17.54µs 1675 tx/sec 1683 tx/sec
stdb_raw 💿 u32_u64_str unique_0 2048 256 508.7±24.19µs 464.9±62.11µs 1965 tx/sec 2.1 Ktx/sec
stdb_raw 💿 u32_u64_u64 btree_each_column 2048 256 370.9±4.78µs 368.1±18.72µs 2.6 Ktx/sec 2.7 Ktx/sec
stdb_raw 💿 u32_u64_u64 unique_0 2048 256 346.8±13.80µs 343.8±7.85µs 2.8 Ktx/sec 2.8 Ktx/sec
stdb_raw 🧠 u32_u64_str btree_each_column 2048 256 295.5±0.35µs 302.9±0.18µs 3.3 Ktx/sec 3.2 Ktx/sec
stdb_raw 🧠 u32_u64_str unique_0 2048 256 228.0±0.37µs 233.0±0.26µs 4.3 Ktx/sec 4.2 Ktx/sec
stdb_raw 🧠 u32_u64_u64 btree_each_column 2048 256 235.8±0.24µs 234.7±0.29µs 4.1 Ktx/sec 4.2 Ktx/sec
stdb_raw 🧠 u32_u64_u64 unique_0 2048 256 210.5±0.31µs 209.9±0.15µs 4.6 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.12µs 21.1±0.23µs 40.8 Ktx/sec 46.2 Ktx/sec
sqlite 💿 u32_u64_u64 unique_0 21.8±0.10µs 19.8±0.09µs 44.8 Ktx/sec 49.4 Ktx/sec
sqlite 🧠 u32_u64_str unique_0 21.1±0.14µs 18.9±0.60µs 46.2 Ktx/sec 51.7 Ktx/sec
sqlite 🧠 u32_u64_u64 unique_0 19.1±0.09µs 17.4±0.07µs 51.0 Ktx/sec 56.0 Ktx/sec
stdb_raw 💿 u32_u64_str unique_0 4.9±0.00µs 4.9±0.00µs 199.7 Ktx/sec 198.4 Ktx/sec
stdb_raw 💿 u32_u64_u64 unique_0 4.8±0.00µs 4.8±0.00µs 203.9 Ktx/sec 204.0 Ktx/sec
stdb_raw 🧠 u32_u64_str unique_0 4.9±0.00µs 4.9±0.00µs 199.9 Ktx/sec 198.5 Ktx/sec
stdb_raw 🧠 u32_u64_u64 unique_0 4.8±0.00µs 4.8±0.00µs 203.9 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 69.4±0.27µs 68.8±0.21µs 14.1 Ktx/sec 14.2 Ktx/sec
sqlite 💿 u64 index 2048 256 66.5±0.21µs 63.2±0.31µs 14.7 Ktx/sec 15.4 Ktx/sec
sqlite 🧠 string index 2048 256 64.7±0.18µs 63.6±0.19µs 15.1 Ktx/sec 15.4 Ktx/sec
sqlite 🧠 u64 index 2048 256 59.5±0.18µs 58.0±0.32µs 16.4 Ktx/sec 16.8 Ktx/sec
stdb_raw 💿 string index 2048 256 5.1±0.00µs 5.1±0.00µs 192.7 Ktx/sec 192.1 Ktx/sec
stdb_raw 💿 u64 index 2048 256 5.0±0.00µs 5.0±0.00µs 195.5 Ktx/sec 195.4 Ktx/sec
stdb_raw 🧠 string index 2048 256 5.1±0.00µs 5.1±0.00µs 192.6 Ktx/sec 192.0 Ktx/sec
stdb_raw 🧠 u64 index 2048 256 5.0±0.00µs 5.0±0.01µs 195.6 Ktx/sec 195.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.5±0.01µs 3.5±0.01µs 26.9 Mtx/sec 26.9 Mtx/sec
u32_u64_str bflatn_to_bsatn_slow_path 100 3.5±0.00µs 3.5±0.00µs 27.0 Mtx/sec 27.0 Mtx/sec
u32_u64_str bsatn 100 2.3±0.01µs 2.4±0.00µs 40.8 Mtx/sec 39.3 Mtx/sec
u32_u64_str bsatn 100 7.2±0.17ns 7.1±0.03ns 13.0 Gtx/sec 13.0 Gtx/sec
u32_u64_str json 100 5.4±0.03µs 4.7±0.03µs 17.8 Mtx/sec 20.1 Mtx/sec
u32_u64_str json 100 9.4±0.03µs 8.8±0.14µs 10.1 Mtx/sec 10.8 Mtx/sec
u32_u64_str product_value 100 1020.2±0.75ns 1020.5±0.87ns 93.5 Mtx/sec 93.5 Mtx/sec
u32_u64_u64 bflatn_to_bsatn_fast_path 100 984.1±50.51ns 919.5±14.67ns 96.9 Mtx/sec 103.7 Mtx/sec
u32_u64_u64 bflatn_to_bsatn_slow_path 100 2.8±0.00µs 2.8±0.00µs 34.3 Mtx/sec 34.3 Mtx/sec
u32_u64_u64 bsatn 100 1768.5±11.49ns 1734.6±44.98ns 53.9 Mtx/sec 55.0 Mtx/sec
u32_u64_u64 bsatn 100 6.7±0.06ns 6.7±0.17ns 13.8 Gtx/sec 13.8 Gtx/sec
u32_u64_u64 json 100 3.1±0.02µs 3.3±0.09µs 30.7 Mtx/sec 28.6 Mtx/sec
u32_u64_u64 json 100 5.9±0.03µs 6.1±0.12µs 16.0 Mtx/sec 15.5 Mtx/sec
u32_u64_u64 product_value 100 1018.3±0.65ns 1014.4±0.65ns 93.7 Mtx/sec 94.0 Mtx/sec
u64_u64_u32 bflatn_to_bsatn_fast_path 100 751.6±3.36ns 725.0±0.51ns 126.9 Mtx/sec 131.5 Mtx/sec
u64_u64_u32 bflatn_to_bsatn_slow_path 100 2.8±0.01µs 2.8±0.00µs 34.2 Mtx/sec 34.2 Mtx/sec
u64_u64_u32 bsatn 100 1750.7±22.33ns 1732.2±25.77ns 54.5 Mtx/sec 55.1 Mtx/sec
u64_u64_u32 bsatn 100 690.3±1.06ns 690.3±0.76ns 138.1 Mtx/sec 138.2 Mtx/sec
u64_u64_u32 json 100 3.2±0.05µs 3.1±0.03µs 30.1 Mtx/sec 30.3 Mtx/sec
u64_u64_u32 json 100 5.7±0.15µs 6.3±0.18µs 16.8 Mtx/sec 15.1 Mtx/sec
u64_u64_u32 product_value 100 1015.4±0.69ns 1017.0±0.58ns 93.9 Mtx/sec 93.8 Mtx/sec

stdb_module_large_arguments

arg size new latency old latency new throughput old throughput
64KiB 110.8±7.59µs 101.4±9.09µs - -

stdb_module_print_bulk

line count new latency old latency new throughput old throughput
1 44.9±6.79µs 42.0±4.27µs - -
100 596.3±12.21µs 595.7±12.65µs - -
1000 4.9±0.70ms 5.4±0.09ms - -

remaining

name new latency old latency new throughput old throughput
special/db_game/circles/load=10 44.6±3.93ms 38.0±5.08ms - -
special/db_game/circles/load=100 49.8±5.12ms 52.4±6.92ms - -
special/db_game/ia_loop/load=500 147.6±1.04ms 147.3±1.25ms - -
special/db_game/ia_loop/load=5000 5.2±0.04s 5.3±0.03s - -
sqlite/💿/update_bulk/u32_u64_str/unique_0/load=2048/count=256 56.7±0.31µs 52.5±0.12µs 17.2 Ktx/sec 18.6 Ktx/sec
sqlite/💿/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 48.6±0.33µs 44.9±0.04µs 20.1 Ktx/sec 21.7 Ktx/sec
sqlite/🧠/update_bulk/u32_u64_str/unique_0/load=2048/count=256 40.9±0.12µs 37.2±0.10µs 23.9 Ktx/sec 26.2 Ktx/sec
sqlite/🧠/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 36.1±0.15µs 34.0±0.11µs 27.0 Ktx/sec 28.7 Ktx/sec
stdb_module/💿/update_bulk/u32_u64_str/unique_0/load=2048/count=256 1261.4±11.70µs 1282.8±7.00µs 792 tx/sec 779 tx/sec
stdb_module/💿/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 989.7±8.66µs 995.7±11.27µs 1010 tx/sec 1004 tx/sec
stdb_raw/💿/update_bulk/u32_u64_str/unique_0/load=2048/count=256 527.7±11.03µs 628.2±19.07µs 1894 tx/sec 1591 tx/sec
stdb_raw/💿/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 479.5±9.38µs 479.0±8.01µs 2.0 Ktx/sec 2.0 Ktx/sec
stdb_raw/🧠/update_bulk/u32_u64_str/unique_0/load=2048/count=256 362.8±0.55µs 361.9±0.31µs 2.7 Ktx/sec 2.7 Ktx/sec
stdb_raw/🧠/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 323.7±0.33µs 324.1±0.41µs 3.0 Ktx/sec 3.0 Ktx/sec

@github-actions
Copy link

@github-actions github-actions bot commented on adf6dab Nov 7, 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% 6491 6491 0.00%
sqlite 5579 5579 0.00% 6047 6051 -0.07%

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% 77033 77037 -0.01%
stdb_raw u32_u64_str no_index 64 128 2 string 120180 119091 0.91% 120854 119923 0.78%
stdb_raw u32_u64_str btree_each_column 64 128 2 string 25083 25083 0.00% 25553 25727 -0.68%
stdb_raw u32_u64_str btree_each_column 64 128 1 u64 24051 24051 0.00% 24535 24479 0.23%
sqlite u32_u64_str no_index 64 128 2 string 144695 144695 0.00% 146159 146215 -0.04%
sqlite u32_u64_str no_index 64 128 1 u64 124056 124044 0.01% 125382 125320 0.05%
sqlite u32_u64_str btree_each_column 64 128 1 u64 131361 131361 0.00% 132835 132813 0.02%
sqlite u32_u64_str btree_each_column 64 128 2 string 134494 134500 -0.00% 136082 136212 -0.10%

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 877188 876906 0.03% 897404 901218 -0.42%
stdb_raw u32_u64_str btree_each_column 64 128 1026705 1024140 0.25% 1087009 1048840 3.64%
sqlite u32_u64_str unique_0 64 128 398320 398320 0.00% 416162 413316 0.69%
sqlite u32_u64_str btree_each_column 64 128 983637 983637 0.00% 1024023 1018735 0.52%

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% 153834 153800 0.02%
stdb_raw u32_u64_str unique_0 64 16751 16751 0.00% 16843 16809 0.20%
sqlite u32_u64_str unique_0 1024 1067255 1067255 0.00% 1070643 1070583 0.01%
sqlite u32_u64_str unique_0 64 76201 76201 0.00% 77187 77195 -0.01%

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 50146 0.27%
64 bsatn 25509 25509 0.00% 27719 27685 0.12%
16 bsatn 8200 8200 0.00% 9526 9492 0.36%
16 json 12188 12188 0.00% 14194 14058 0.97%

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 20073533 20491290 -2.04% 20663205 21121342 -2.17%
stdb_raw u32_u64_str unique_0 64 128 1283783 1284809 -0.08% 1357743 1327735 2.26%
sqlite u32_u64_str unique_0 1024 1024 1802182 1802200 -0.00% 1811420 1811480 -0.00%
sqlite u32_u64_str unique_0 64 128 128528 128528 0.00% 131350 131412 -0.05%
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% 6512 6512 0.00%
sqlite 5621 5621 0.00% 6157 6153 0.07%

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% 77014 77038 -0.03%
stdb_raw u32_u64_str no_index 64 128 2 string 119096 119088 0.01% 119742 119864 -0.10%
stdb_raw u32_u64_str btree_each_column 64 128 2 string 25091 25089 0.01% 25533 25637 -0.41%
stdb_raw u32_u64_str btree_each_column 64 128 1 u64 24056 24056 0.00% 24496 24456 0.16%
sqlite u32_u64_str no_index 64 128 1 u64 125965 125965 0.00% 127531 127637 -0.08%
sqlite u32_u64_str no_index 64 128 2 string 146616 146616 0.00% 148352 148500 -0.10%
sqlite u32_u64_str btree_each_column 64 128 2 string 136616 136616 0.00% 138618 138786 -0.12%
sqlite u32_u64_str btree_each_column 64 128 1 u64 133457 133457 0.00% 135325 135259 0.05%

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 826529 825503 0.12% 876731 848737 3.30%
stdb_raw u32_u64_str btree_each_column 64 128 975979 976580 -0.06% 1034941 1030650 0.42%
sqlite u32_u64_str unique_0 64 128 415857 415857 0.00% 433013 430131 0.67%
sqlite u32_u64_str btree_each_column 64 128 1021898 1021898 0.00% 1062146 1056380 0.55%

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% 153823 153785 0.02%
stdb_raw u32_u64_str unique_0 64 16756 16756 0.00% 16844 16810 0.20%
sqlite u32_u64_str unique_0 1024 1070323 1070323 0.00% 1074097 1074041 0.01%
sqlite u32_u64_str unique_0 64 77973 77973 0.00% 79267 79211 0.07%

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 50146 0.27%
64 bsatn 25509 25509 0.00% 27719 27685 0.12%
16 bsatn 8200 8200 0.00% 9526 9492 0.36%
16 json 12188 12188 0.00% 14194 14058 0.97%

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 18998637 19002188 -0.02% 19707547 19660380 0.24%
stdb_raw u32_u64_str unique_0 64 128 1238074 1237387 0.06% 1313052 1309539 0.27%
sqlite u32_u64_str unique_0 1024 1024 1809743 1809743 0.00% 1818313 1818387 -0.00%
sqlite u32_u64_str unique_0 64 128 132654 132660 -0.00% 135620 135596 0.02%

Please sign in to comment.