Skip to content

Commit

Permalink
[bindings-csharp] Upgrade WASI SDK & enable for ARM64 (#1775)
Browse files Browse the repository at this point in the history
  • Loading branch information
RReverser authored Oct 1, 2024
1 parent 039c7e2 commit efa9e0b
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions crates/bindings-csharp/Runtime/build/SpacetimeDB.Runtime.targets
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,18 @@
<!-- TODO: remove when https://github.com/dotnet/runtime/issues/82788 is resolved. -->
<Target Name="ObtainWasiSdk" BeforeTargets="_SetupWasiSdk;CheckWasmSdks">
<PropertyGroup>
<WasiSdkVersion>20</WasiSdkVersion>
<WasiSdkVersion>24</WasiSdkVersion>

<WasiSdkDownloadTempFile>$([System.IO.Path]::Combine($(IntermediateOutputPath), "wasi-sdk.$(WasiSdkVersion).tar.gz"))</WasiSdkDownloadTempFile>

<WasiSdkFilenameSuffix Condition="$([MSBuild]::IsOSPlatform('Windows'))">.m-mingw</WasiSdkFilenameSuffix>
<WasiSdkFilenameSuffix Condition="$([MSBuild]::IsOSPlatform('Linux'))">-linux</WasiSdkFilenameSuffix>
<WasiSdkFilenameSuffix Condition="$([MSBuild]::IsOSPlatform('OSX'))">-macos</WasiSdkFilenameSuffix>
<WasiSdkArch Condition="$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture) == X64">x86_64</WasiSdkArch>
<WasiSdkArch Condition="$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture) == Arm64">arm64</WasiSdkArch>

<WasiSdkUrl>https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-$(WasiSdkVersion)/wasi-sdk-$(WasiSdkVersion).0$(WasiSdkFilenameSuffix).tar.gz</WasiSdkUrl>
<WasiSdkOS Condition="$([MSBuild]::IsOSPlatform('Windows'))">windows</WasiSdkOS>
<WasiSdkOS Condition="$([MSBuild]::IsOSPlatform('Linux'))">linux</WasiSdkOS>
<WasiSdkOS Condition="$([MSBuild]::IsOSPlatform('OSX'))">macos</WasiSdkOS>

<WasiSdkUrl>https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-$(WasiSdkVersion)/wasi-sdk-$(WasiSdkVersion).0-$(WasiSdkArch)-$(WasiSdkOS).tar.gz</WasiSdkUrl>

<WasiSdkRoot>$([System.IO.Path]::Combine($([System.Environment]::GetFolderPath(SpecialFolder.UserProfile)), '.wasi-sdk', "wasi-sdk-$(WasiSdkVersion)"))</WasiSdkRoot>
<WASI_SDK_PATH>$(WasiSdkRoot)</WASI_SDK_PATH>
Expand Down

2 comments on commit efa9e0b

@github-actions
Copy link

@github-actions github-actions bot commented on efa9e0b Oct 1, 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 5395 5395 0.00% 5441 5441 0.00%
sqlite 5509 5509 0.00% 5927 5927 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 2 string 117799 117799 0.00% 118353 118405 -0.04%
stdb_raw u32_u64_str no_index 64 128 1 u64 75388 75388 0.00% 75818 75818 0.00%
stdb_raw u32_u64_str btree_each_column 64 128 2 string 24055 24055 0.00% 24537 24533 0.02%
stdb_raw u32_u64_str btree_each_column 64 128 1 u64 23023 23023 0.00% 23453 23449 0.02%
sqlite u32_u64_str no_index 64 128 2 string 144619 144619 0.00% 146003 146003 0.00%
sqlite u32_u64_str no_index 64 128 1 u64 124017 124017 0.00% 125223 125223 0.00%
sqlite u32_u64_str btree_each_column 64 128 2 string 134418 134418 0.00% 136090 136082 0.01%
sqlite u32_u64_str btree_each_column 64 128 1 u64 131334 131352 -0.01% 132826 132844 -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 900225 900088 0.02% 962215 962228 -0.00%
stdb_raw u32_u64_str btree_each_column 64 128 1050087 1055327 -0.50% 1125303 1098963 2.40%
sqlite u32_u64_str unique_0 64 128 398156 398156 0.00% 417990 417990 0.00%
sqlite u32_u64_str btree_each_column 64 128 983483 983483 0.00% 1019677 1019693 -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 152681 152681 0.00% 152765 152765 0.00%
stdb_raw u32_u64_str unique_0 64 15706 15706 0.00% 15786 15790 -0.03%
sqlite u32_u64_str unique_0 1024 1046653 1046653 0.00% 1049997 1049997 0.00%
sqlite u32_u64_str unique_0 64 74799 74799 0.00% 75789 75789 0.00%

callgrind: serialize_product_value

count format total reads + writes old total reads + writes Δrw estimated cycles old estimated cycles Δcycles
64 json 47374 47374 0.00% 50132 50132 0.00%
64 bsatn 25716 25716 0.00% 27994 27994 0.00%
16 json 12126 12126 0.00% 14098 14098 0.00%
16 bsatn 8117 8117 0.00% 9511 9511 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 20660751 20438605 1.09% 21479653 21252103 1.07%
stdb_raw u32_u64_str unique_0 64 128 1303704 1304046 -0.03% 1360304 1360686 -0.03%
sqlite u32_u64_str unique_0 1024 1024 1802101 1802101 0.00% 1811547 1811543 0.00%
sqlite u32_u64_str unique_0 64 128 128447 128447 0.00% 131221 131221 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 5405 5405 0.00% 5451 5451 0.00%
sqlite 5551 5551 0.00% 6033 6033 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 2 string 117809 117809 0.00% 118427 118403 0.02%
stdb_raw u32_u64_str no_index 64 128 1 u64 75398 75398 0.00% 75824 75824 0.00%
stdb_raw u32_u64_str btree_each_column 64 128 2 string 24066 24067 -0.00% 24540 24541 -0.00%
stdb_raw u32_u64_str btree_each_column 64 128 1 u64 23033 23033 0.00% 23455 23455 0.00%
sqlite u32_u64_str no_index 64 128 2 string 146540 146540 0.00% 148356 148356 0.00%
sqlite u32_u64_str no_index 64 128 1 u64 125928 125928 0.00% 127476 127480 -0.00%
sqlite u32_u64_str btree_each_column 64 128 2 string 136558 136540 0.01% 138724 138702 0.02%
sqlite u32_u64_str btree_each_column 64 128 1 u64 133420 133420 0.00% 135330 135334 -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 849295 848575 0.08% 910261 910257 0.00%
stdb_raw u32_u64_str btree_each_column 64 128 1000199 1001315 -0.11% 1073593 1075231 -0.15%
sqlite u32_u64_str unique_0 64 128 415693 415693 0.00% 434851 434867 -0.00%
sqlite u32_u64_str btree_each_column 64 128 1021740 1021734 0.00% 1056632 1056614 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 152691 152691 0.00% 152771 152771 0.00%
stdb_raw u32_u64_str unique_0 64 15716 15716 0.00% 15796 15796 0.00%
sqlite u32_u64_str unique_0 1024 1049721 1049721 0.00% 1053443 1053443 0.00%
sqlite u32_u64_str unique_0 64 76571 76571 0.00% 77841 77841 0.00%

callgrind: serialize_product_value

count format total reads + writes old total reads + writes Δrw estimated cycles old estimated cycles Δcycles
64 json 47374 47374 0.00% 50132 50132 0.00%
64 bsatn 25716 25716 0.00% 27994 27994 0.00%
16 json 12126 12126 0.00% 14098 14098 0.00%
16 bsatn 8117 8117 0.00% 9511 9511 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 19366441 19357785 0.04% 20278231 20250223 0.14%
stdb_raw u32_u64_str unique_0 64 128 1256435 1256387 0.00% 1342699 1342249 0.03%
sqlite u32_u64_str unique_0 1024 1024 1809652 1809652 0.00% 1818234 1818234 0.00%
sqlite u32_u64_str unique_0 64 128 132563 132563 0.00% 135573 135573 0.00%

@github-actions
Copy link

@github-actions github-actions bot commented on efa9e0b Oct 1, 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 💿 411.4±0.66ns 408.8±1.26ns - -
sqlite 🧠 399.0±1.56ns 402.7±0.97ns - -
stdb_raw 💿 632.0±0.91ns 634.7±1.27ns - -
stdb_raw 🧠 633.2±1.38ns 634.3±1.06ns - -

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 584.1±15.16µs 578.6±0.76µs 1711 tx/sec 1728 tx/sec
sqlite 💿 u32_u64_str unique_0 2048 256 146.9±0.42µs 147.3±0.91µs 6.6 Ktx/sec 6.6 Ktx/sec
sqlite 💿 u32_u64_u64 btree_each_column 2048 256 461.9±0.74µs 459.5±0.63µs 2.1 Ktx/sec 2.1 Ktx/sec
sqlite 💿 u32_u64_u64 unique_0 2048 256 132.4±0.18µs 139.8±14.84µs 7.4 Ktx/sec 7.0 Ktx/sec
sqlite 🧠 u32_u64_str btree_each_column 2048 256 443.2±0.69µs 439.5±0.66µs 2.2 Ktx/sec 2.2 Ktx/sec
sqlite 🧠 u32_u64_str unique_0 2048 256 117.5±0.58µs 119.2±0.86µs 8.3 Ktx/sec 8.2 Ktx/sec
sqlite 🧠 u32_u64_u64 btree_each_column 2048 256 363.2±0.73µs 359.3±0.77µs 2.7 Ktx/sec 2.7 Ktx/sec
sqlite 🧠 u32_u64_u64 unique_0 2048 256 102.1±1.10µs 104.1±0.41µs 9.6 Ktx/sec 9.4 Ktx/sec
stdb_raw 💿 u32_u64_str btree_each_column 2048 256 573.4±25.83µs 640.3±18.38µs 1744 tx/sec 1561 tx/sec
stdb_raw 💿 u32_u64_str unique_0 2048 256 483.8±23.19µs 490.7±38.89µs 2.0 Ktx/sec 2037 tx/sec
stdb_raw 💿 u32_u64_u64 btree_each_column 2048 256 349.3±5.41µs 383.8±6.76µs 2.8 Ktx/sec 2.5 Ktx/sec
stdb_raw 💿 u32_u64_u64 unique_0 2048 256 313.6±23.15µs 350.9±8.03µs 3.1 Ktx/sec 2.8 Ktx/sec
stdb_raw 🧠 u32_u64_str btree_each_column 2048 256 307.1±0.15µs 305.2±0.13µs 3.2 Ktx/sec 3.2 Ktx/sec
stdb_raw 🧠 u32_u64_str unique_0 2048 256 237.7±0.29µs 240.0±0.37µs 4.1 Ktx/sec 4.1 Ktx/sec
stdb_raw 🧠 u32_u64_u64 btree_each_column 2048 256 242.8±0.10µs 242.7±0.08µs 4.0 Ktx/sec 4.0 Ktx/sec
stdb_raw 🧠 u32_u64_u64 unique_0 2048 256 217.7±0.40µs 218.1±0.19µs 4.5 Ktx/sec 4.5 Ktx/sec

iterate

db on disk schema indices new latency old latency new throughput old throughput
sqlite 💿 u32_u64_str unique_0 20.1±0.06µs 20.6±0.08µs 48.6 Ktx/sec 47.4 Ktx/sec
sqlite 💿 u32_u64_u64 unique_0 18.6±0.07µs 19.2±0.06µs 52.6 Ktx/sec 50.9 Ktx/sec
sqlite 🧠 u32_u64_str unique_0 17.6±0.06µs 17.8±0.06µs 55.4 Ktx/sec 54.8 Ktx/sec
sqlite 🧠 u32_u64_u64 unique_0 16.1±0.03µs 16.7±0.04µs 60.6 Ktx/sec 58.5 Ktx/sec
stdb_raw 💿 u32_u64_str unique_0 3.8±0.00µs 4.8±0.00µs 255.2 Ktx/sec 205.4 Ktx/sec
stdb_raw 💿 u32_u64_u64 unique_0 3.7±0.00µs 4.6±0.00µs 263.7 Ktx/sec 211.0 Ktx/sec
stdb_raw 🧠 u32_u64_str unique_0 3.8±0.00µs 4.8±0.00µs 254.7 Ktx/sec 205.2 Ktx/sec
stdb_raw 🧠 u32_u64_u64 unique_0 3.7±0.00µs 4.6±0.01µs 263.8 Ktx/sec 211.0 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.5±0.18µs 68.9±0.28µs 14.0 Ktx/sec 14.2 Ktx/sec
sqlite 💿 u64 index 2048 256 64.2±0.02µs 64.3±0.13µs 15.2 Ktx/sec 15.2 Ktx/sec
sqlite 🧠 string index 2048 256 66.4±0.21µs 64.5±0.17µs 14.7 Ktx/sec 15.1 Ktx/sec
sqlite 🧠 u64 index 2048 256 59.3±0.10µs 58.1±0.08µs 16.5 Ktx/sec 16.8 Ktx/sec
stdb_raw 💿 string index 2048 256 4.8±0.00µs 4.9±0.00µs 204.7 Ktx/sec 198.5 Ktx/sec
stdb_raw 💿 u64 index 2048 256 4.8±0.00µs 4.7±0.00µs 201.6 Ktx/sec 208.1 Ktx/sec
stdb_raw 🧠 string index 2048 256 4.8±0.00µs 4.9±0.00µs 204.6 Ktx/sec 198.3 Ktx/sec
stdb_raw 🧠 u64 index 2048 256 4.8±0.00µs 4.7±0.00µs 201.7 Ktx/sec 208.2 Ktx/sec

serialize

schema format count new latency old latency new throughput old throughput
u32_u64_str bflatn_to_bsatn_fast_path 100 3.3±0.01µs 3.4±0.03µs 29.3 Mtx/sec 28.4 Mtx/sec
u32_u64_str bflatn_to_bsatn_slow_path 100 3.0±0.01µs 3.0±0.03µs 31.5 Mtx/sec 31.3 Mtx/sec
u32_u64_str bsatn 100 2.3±0.00µs 2.3±0.00µs 41.1 Mtx/sec 41.2 Mtx/sec
u32_u64_str bsatn 100 40.5±0.07ns 40.5±0.09ns 2.3 Gtx/sec 2.3 Gtx/sec
u32_u64_str json 100 5.9±0.05µs 5.7±0.09µs 16.2 Mtx/sec 16.7 Mtx/sec
u32_u64_str json 100 8.3±0.02µs 8.4±0.03µs 11.4 Mtx/sec 11.4 Mtx/sec
u32_u64_str product_value 100 1015.8±0.68ns 1015.9±0.83ns 93.9 Mtx/sec 93.9 Mtx/sec
u32_u64_u64 bflatn_to_bsatn_fast_path 100 1125.9±1.50ns 1137.2±1.79ns 84.7 Mtx/sec 83.9 Mtx/sec
u32_u64_u64 bflatn_to_bsatn_slow_path 100 2.5±0.00µs 2.5±0.00µs 38.7 Mtx/sec 38.6 Mtx/sec
u32_u64_u64 bsatn 100 1688.7±37.86ns 1782.1±46.36ns 56.5 Mtx/sec 53.5 Mtx/sec
u32_u64_u64 bsatn 100 39.4±0.08ns 39.4±0.11ns 2.4 Gtx/sec 2.4 Gtx/sec
u32_u64_u64 json 100 3.4±0.08µs 3.3±0.03µs 27.8 Mtx/sec 29.1 Mtx/sec
u32_u64_u64 json 100 4.9±0.00µs 4.9±0.01µs 19.4 Mtx/sec 19.6 Mtx/sec
u32_u64_u64 product_value 100 1014.8±1.02ns 1014.4±3.35ns 94.0 Mtx/sec 94.0 Mtx/sec
u64_u64_u32 bflatn_to_bsatn_fast_path 100 895.8±0.52ns 899.8±2.48ns 106.5 Mtx/sec 106.0 Mtx/sec
u64_u64_u32 bflatn_to_bsatn_slow_path 100 2.5±0.00µs 2.5±0.00µs 38.7 Mtx/sec 38.6 Mtx/sec
u64_u64_u32 bsatn 100 1736.9±33.34ns 1719.2±34.79ns 54.9 Mtx/sec 55.5 Mtx/sec
u64_u64_u32 bsatn 100 749.5±0.55ns 755.0±0.46ns 127.2 Mtx/sec 126.3 Mtx/sec
u64_u64_u32 json 100 3.5±0.15µs 3.3±0.10µs 27.1 Mtx/sec 29.2 Mtx/sec
u64_u64_u32 json 100 5.0±0.04µs 5.0±0.01µs 18.9 Mtx/sec 19.1 Mtx/sec
u64_u64_u32 product_value 100 1014.4±0.74ns 1014.2±0.76ns 94.0 Mtx/sec 94.0 Mtx/sec

stdb_module_large_arguments

arg size new latency old latency new throughput old throughput
64KiB 115.9±11.85µs 112.3±6.44µs - -

stdb_module_print_bulk

line count new latency old latency new throughput old throughput
1 52.3±7.53µs 54.1±5.97µs - -
100 599.4±5.98µs 594.8±13.82µs - -
1000 5.4±0.05ms 5.2±0.62ms - -

remaining

name new latency old latency new throughput old throughput
special/db_game/circles/load=10 297.4±2.57µs 294.4±2.37µs - -
special/db_game/circles/load=100 297.0±3.43µs 291.5±6.68µs - -
special/db_game/ia_loop/load=10 0.0±0.00ns 0.0±0.00ns - -
special/db_game/ia_loop/load=100 0.0±0.00ns 0.0±0.00ns - -
sqlite/💿/update_bulk/u32_u64_str/unique_0/load=2048/count=256 51.8±0.25µs 52.2±0.52µs 18.9 Ktx/sec 18.7 Ktx/sec
sqlite/💿/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 44.4±0.13µs 44.8±0.12µs 22.0 Ktx/sec 21.8 Ktx/sec
sqlite/🧠/update_bulk/u32_u64_str/unique_0/load=2048/count=256 37.8±0.13µs 38.0±0.04µs 25.8 Ktx/sec 25.7 Ktx/sec
sqlite/🧠/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 33.7±0.08µs 33.8±0.04µs 29.0 Ktx/sec 28.9 Ktx/sec
stdb_module/💿/update_bulk/u32_u64_str/unique_0/load=2048/count=256 1281.7±9.87µs 1286.6±14.26µs 780 tx/sec 777 tx/sec
stdb_module/💿/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 1030.0±7.20µs 1019.7±9.16µs 970 tx/sec 980 tx/sec
stdb_raw/💿/update_bulk/u32_u64_str/unique_0/load=2048/count=256 643.5±18.81µs 557.6±34.29µs 1554 tx/sec 1793 tx/sec
stdb_raw/💿/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 488.9±8.00µs 438.4±4.97µs 2045 tx/sec 2.2 Ktx/sec
stdb_raw/🧠/update_bulk/u32_u64_str/unique_0/load=2048/count=256 367.1±0.45µs 371.0±0.23µs 2.7 Ktx/sec 2.6 Ktx/sec
stdb_raw/🧠/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 335.0±0.23µs 334.2±0.38µs 2.9 Ktx/sec 2.9 Ktx/sec

Please sign in to comment.