Skip to content

Commit

Permalink
CLI - Fix spacetime server edit failing on renames (#1877)
Browse files Browse the repository at this point in the history
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
  • Loading branch information
bfops and bfops authored Oct 17, 2024
1 parent 637d6d7 commit c98fe97
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions crates/cli/src/subcommands/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ pub async fn exec_edit(mut config: Config, args: &ArgMatches) -> Result<(), anyh
}

let (old_nick, old_host, old_proto) = config.edit_server(server, new_nick, new_host, new_proto)?;
let server = new_nick.unwrap_or(server);

if let (Some(new_nick), Some(old_nick)) = (new_nick, old_nick) {
println!("Changing nickname from {} to {}", old_nick, new_nick);
Expand Down
9 changes: 9 additions & 0 deletions smoketests/tests/servers.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,12 @@ def test_servers(self):

out = self.spacetime("server", "fingerprint", "-s", "localhost")
self.assertIn("Fingerprint is unchanged for server localhost", out)

def test_edit_server(self):
"""Verify that we can edit server configurations"""

out = self.spacetime("server", "add", "https://foo.com", "foo", "--no-fingerprint")
out = self.spacetime("server", "edit", "-s", "foo", "--host", "edited-testnet.spacetimedb.com", "--nickname", "edited-testnet", "--no-fingerprint", "--yes")

servers = self.spacetime("server", "list")
self.assertRegex(servers, re.compile(r"^\s*edited-testnet\.spacetimedb\.com\s+https\s+edited-testnet\s*$", re.M))

2 comments on commit c98fe97

@github-actions
Copy link

@github-actions github-actions bot commented on c98fe97 Oct 17, 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 💿 410.7±1.13ns 419.4±2.73ns - -
sqlite 🧠 407.0±1.34ns 409.5±1.91ns - -
stdb_raw 💿 627.6±0.31ns 623.1±1.20ns - -
stdb_raw 🧠 627.6±0.70ns 623.7±1.32ns - -

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 582.1±0.80µs 589.4±0.52µs 1717 tx/sec 1696 tx/sec
sqlite 💿 u32_u64_str unique_0 2048 256 149.5±0.52µs 152.5±0.33µs 6.5 Ktx/sec 6.4 Ktx/sec
sqlite 💿 u32_u64_u64 btree_each_column 2048 256 463.6±0.64µs 467.7±0.82µs 2.1 Ktx/sec 2.1 Ktx/sec
sqlite 💿 u32_u64_u64 unique_0 2048 256 135.7±0.53µs 138.2±0.97µs 7.2 Ktx/sec 7.1 Ktx/sec
sqlite 🧠 u32_u64_str btree_each_column 2048 256 442.5±0.34µs 449.0±0.64µs 2.2 Ktx/sec 2.2 Ktx/sec
sqlite 🧠 u32_u64_str unique_0 2048 256 121.4±0.74µs 124.6±0.49µs 8.0 Ktx/sec 7.8 Ktx/sec
sqlite 🧠 u32_u64_u64 btree_each_column 2048 256 359.4±0.31µs 366.3±0.33µs 2.7 Ktx/sec 2.7 Ktx/sec
sqlite 🧠 u32_u64_u64 unique_0 2048 256 106.5±0.55µs 104.4±1.10µs 9.2 Ktx/sec 9.4 Ktx/sec
stdb_raw 💿 u32_u64_str btree_each_column 2048 256 640.3±27.70µs 640.0±22.13µs 1561 tx/sec 1562 tx/sec
stdb_raw 💿 u32_u64_str unique_0 2048 256 433.6±41.31µs 416.9±13.11µs 2.3 Ktx/sec 2.3 Ktx/sec
stdb_raw 💿 u32_u64_u64 btree_each_column 2048 256 380.3±7.52µs 390.1±7.84µs 2.6 Ktx/sec 2.5 Ktx/sec
stdb_raw 💿 u32_u64_u64 unique_0 2048 256 351.4±9.12µs 353.3±20.41µs 2.8 Ktx/sec 2.8 Ktx/sec
stdb_raw 🧠 u32_u64_str btree_each_column 2048 256 307.3±0.34µs 307.9±0.19µs 3.2 Ktx/sec 3.2 Ktx/sec
stdb_raw 🧠 u32_u64_str unique_0 2048 256 241.7±0.25µs 242.1±0.69µs 4.0 Ktx/sec 4.0 Ktx/sec
stdb_raw 🧠 u32_u64_u64 btree_each_column 2048 256 244.7±0.13µs 247.2±0.14µs 4.0 Ktx/sec 4.0 Ktx/sec
stdb_raw 🧠 u32_u64_u64 unique_0 2048 256 219.4±0.31µs 218.9±0.38µ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 22.8±0.26µs 23.5±0.13µs 42.8 Ktx/sec 41.6 Ktx/sec
sqlite 💿 u32_u64_u64 unique_0 21.9±0.36µs 21.7±0.17µs 44.7 Ktx/sec 44.9 Ktx/sec
sqlite 🧠 u32_u64_str unique_0 20.1±0.09µs 21.4±0.11µs 48.5 Ktx/sec 45.7 Ktx/sec
sqlite 🧠 u32_u64_u64 unique_0 18.8±0.22µs 19.2±0.23µs 51.9 Ktx/sec 50.8 Ktx/sec
stdb_raw 💿 u32_u64_str unique_0 4.8±0.00µs 4.8±0.00µs 203.9 Ktx/sec 204.8 Ktx/sec
stdb_raw 💿 u32_u64_u64 unique_0 4.7±0.00µs 4.6±0.00µs 209.7 Ktx/sec 210.1 Ktx/sec
stdb_raw 🧠 u32_u64_str unique_0 4.8±0.00µs 4.8±0.00µs 204.3 Ktx/sec 204.6 Ktx/sec
stdb_raw 🧠 u32_u64_u64 unique_0 4.7±0.00µs 4.6±0.00µs 209.7 Ktx/sec 210.1 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 71.0±0.44µs 69.5±0.29µs 13.7 Ktx/sec 14.1 Ktx/sec
sqlite 💿 u64 index 2048 256 66.8±0.26µs 65.8±0.04µs 14.6 Ktx/sec 14.8 Ktx/sec
sqlite 🧠 string index 2048 256 67.0±0.35µs 65.2±0.12µs 14.6 Ktx/sec 15.0 Ktx/sec
sqlite 🧠 u64 index 2048 256 60.4±0.18µs 59.9±0.08µs 16.2 Ktx/sec 16.3 Ktx/sec
stdb_raw 💿 string index 2048 256 4.8±0.00µs 7.0±0.00µs 202.7 Ktx/sec 138.7 Ktx/sec
stdb_raw 💿 u64 index 2048 256 4.7±0.00µs 4.7±0.00µs 208.5 Ktx/sec 208.4 Ktx/sec
stdb_raw 🧠 string index 2048 256 4.8±0.00µs 7.0±0.00µs 202.7 Ktx/sec 138.9 Ktx/sec
stdb_raw 🧠 u64 index 2048 256 4.7±0.00µs 4.7±0.00µs 208.8 Ktx/sec 208.5 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.8 Mtx/sec 26.8 Mtx/sec
u32_u64_str bflatn_to_bsatn_slow_path 100 3.2±0.02µs 3.1±0.04µs 30.1 Mtx/sec 30.3 Mtx/sec
u32_u64_str bsatn 100 2.5±0.01µs 2.3±0.05µs 38.2 Mtx/sec 41.8 Mtx/sec
u32_u64_str bsatn 100 40.3±0.12ns 39.8±0.15ns 2.3 Gtx/sec 2.3 Gtx/sec
u32_u64_str json 100 5.2±0.02µs 4.8±0.05µs 18.4 Mtx/sec 19.9 Mtx/sec
u32_u64_str json 100 8.0±0.01µs 8.1±0.01µs 11.9 Mtx/sec 11.8 Mtx/sec
u32_u64_str product_value 100 1016.8±0.45ns 1019.3±3.21ns 93.8 Mtx/sec 93.6 Mtx/sec
u32_u64_u64 bflatn_to_bsatn_fast_path 100 960.3±6.07ns 951.2±2.00ns 99.3 Mtx/sec 100.3 Mtx/sec
u32_u64_u64 bflatn_to_bsatn_slow_path 100 2.4±0.02µs 2.4±0.01µs 39.8 Mtx/sec 39.8 Mtx/sec
u32_u64_u64 bsatn 100 1715.6±34.02ns 1558.2±18.97ns 55.6 Mtx/sec 61.2 Mtx/sec
u32_u64_u64 bsatn 100 38.7±0.11ns 28.8±0.15ns 2.4 Gtx/sec 3.2 Gtx/sec
u32_u64_u64 json 100 3.4±0.07µs 3.3±0.02µs 27.8 Mtx/sec 29.0 Mtx/sec
u32_u64_u64 json 100 4.9±0.00µs 4.8±0.06µs 19.5 Mtx/sec 20.0 Mtx/sec
u32_u64_u64 product_value 100 1013.3±1.71ns 1012.9±1.47ns 94.1 Mtx/sec 94.2 Mtx/sec
u64_u64_u32 bflatn_to_bsatn_fast_path 100 709.0±1.44ns 714.1±0.70ns 134.5 Mtx/sec 133.5 Mtx/sec
u64_u64_u32 bflatn_to_bsatn_slow_path 100 2.4±0.02µs 2.4±0.01µs 39.2 Mtx/sec 39.9 Mtx/sec
u64_u64_u32 bsatn 100 1078.6±0.74ns 1078.2±0.55ns 88.4 Mtx/sec 88.4 Mtx/sec
u64_u64_u32 bsatn 100 1701.3±31.17ns 1532.5±14.80ns 56.1 Mtx/sec 62.2 Mtx/sec
u64_u64_u32 json 100 3.4±0.13µs 3.3±0.03µs 27.7 Mtx/sec 28.8 Mtx/sec
u64_u64_u32 json 100 5.3±0.01µs 5.0±0.04µs 17.9 Mtx/sec 19.0 Mtx/sec
u64_u64_u32 product_value 100 1014.6±0.48ns 1015.5±4.23ns 94.0 Mtx/sec 93.9 Mtx/sec

stdb_module_large_arguments

arg size new latency old latency new throughput old throughput
64KiB 108.9±7.02µs 111.6±14.20µs - -

stdb_module_print_bulk

line count new latency old latency new throughput old throughput
1 56.9±4.64µs 42.8±6.04µs - -
100 599.2±7.12µs 600.6±6.70µs - -
1000 4.6±0.66ms 3.9±0.87ms - -

remaining

name new latency old latency new throughput old throughput
special/db_game/circles/load=10 303.9±1.71µs 304.1±2.34µs - -
special/db_game/circles/load=100 304.9±4.54µs 302.0±3.21µ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 54.6±0.28µs 57.3±0.12µs 17.9 Ktx/sec 17.0 Ktx/sec
sqlite/💿/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 46.1±0.31µs 47.7±0.32µs 21.2 Ktx/sec 20.5 Ktx/sec
sqlite/🧠/update_bulk/u32_u64_str/unique_0/load=2048/count=256 40.5±0.07µs 41.2±0.30µs 24.1 Ktx/sec 23.7 Ktx/sec
sqlite/🧠/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 34.8±0.11µs 35.3±0.32µs 28.1 Ktx/sec 27.6 Ktx/sec
stdb_module/💿/update_bulk/u32_u64_str/unique_0/load=2048/count=256 1312.4±57.10µs 1289.9±33.15µs 761 tx/sec 775 tx/sec
stdb_module/💿/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 982.8±49.10µs 1023.3±11.03µs 1017 tx/sec 977 tx/sec
stdb_raw/💿/update_bulk/u32_u64_str/unique_0/load=2048/count=256 647.8±18.17µs 650.0±17.83µs 1543 tx/sec 1538 tx/sec
stdb_raw/💿/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 492.3±7.43µs 496.1±8.15µs 2031 tx/sec 2015 tx/sec
stdb_raw/🧠/update_bulk/u32_u64_str/unique_0/load=2048/count=256 376.8±0.54µs 378.2±0.28µs 2.6 Ktx/sec 2.6 Ktx/sec
stdb_raw/🧠/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 340.4±1.78µs 339.3±0.59µs 2.9 Ktx/sec 2.9 Ktx/sec

@github-actions
Copy link

@github-actions github-actions bot commented on c98fe97 Oct 17, 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 5393 5393 0.00% 5469 5469 0.00%
sqlite 5579 5579 0.00% 6009 6009 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 75556 75556 0.00% 75966 75962 0.01%
stdb_raw u32_u64_str no_index 64 128 2 string 118054 118054 0.00% 118570 118606 -0.03%
stdb_raw u32_u64_str btree_each_column 64 128 2 string 24080 24080 0.00% 24500 24504 -0.02%
stdb_raw u32_u64_str btree_each_column 64 128 1 u64 23048 23048 0.00% 23430 23426 0.02%
sqlite u32_u64_str no_index 64 128 2 string 144695 144695 0.00% 146067 146071 -0.00%
sqlite u32_u64_str no_index 64 128 1 u64 124044 124044 0.00% 125226 125222 0.00%
sqlite u32_u64_str btree_each_column 64 128 1 u64 131361 131361 0.00% 132787 132787 0.00%
sqlite u32_u64_str btree_each_column 64 128 2 string 134494 134494 0.00% 136086 136090 -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 900681 900518 0.02% 956569 925766 3.33%
stdb_raw u32_u64_str btree_each_column 64 128 1050276 1052748 -0.23% 1112436 1083814 2.64%
sqlite u32_u64_str unique_0 64 128 398320 398320 0.00% 419584 419592 -0.00%
sqlite u32_u64_str btree_each_column 64 128 983637 983637 0.00% 1022367 1022371 -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 152823 152823 0.00% 152973 152973 0.00%
stdb_raw u32_u64_str unique_0 64 15848 15848 0.00% 15990 15994 -0.03%
sqlite u32_u64_str unique_0 1024 1067255 1067255 0.00% 1070611 1070611 0.00%
sqlite u32_u64_str unique_0 64 76201 76201 0.00% 77267 77267 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% 50184 50184 0.00%
64 bsatn 25509 25509 0.00% 27753 27753 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 20948533 20517129 2.10% 21753833 21277235 2.24%
stdb_raw u32_u64_str unique_0 64 128 1310724 1308794 0.15% 1395766 1393308 0.18%
sqlite u32_u64_str unique_0 1024 1024 1802182 1802182 0.00% 1811668 1811664 0.00%
sqlite u32_u64_str unique_0 64 128 128528 128528 0.00% 131378 131378 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 5398 5398 0.00% 5474 5478 -0.07%
sqlite 5621 5621 0.00% 6107 6107 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 75561 75561 0.00% 75967 75967 0.00%
stdb_raw u32_u64_str no_index 64 128 2 string 118059 118059 0.00% 118579 118595 -0.01%
stdb_raw u32_u64_str btree_each_column 64 128 2 string 24086 24086 0.00% 24506 24502 0.02%
stdb_raw u32_u64_str btree_each_column 64 128 1 u64 23053 23053 0.00% 23427 23427 0.00%
sqlite u32_u64_str no_index 64 128 1 u64 125965 125965 0.00% 127495 127495 0.00%
sqlite u32_u64_str no_index 64 128 2 string 146616 146616 0.00% 148316 148316 0.00%
sqlite u32_u64_str btree_each_column 64 128 2 string 136616 136616 0.00% 138682 138682 0.00%
sqlite u32_u64_str btree_each_column 64 128 1 u64 133457 133457 0.00% 135333 135333 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 850441 851415 -0.11% 906211 907415 -0.13%
stdb_raw u32_u64_str btree_each_column 64 128 999909 999915 -0.00% 1060247 1060275 -0.00%
sqlite u32_u64_str unique_0 64 128 415863 415857 0.00% 436393 436387 0.00%
sqlite u32_u64_str btree_each_column 64 128 1021898 1021898 0.00% 1061164 1061168 -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 152828 152828 0.00% 152970 152970 0.00%
stdb_raw u32_u64_str unique_0 64 15853 15853 0.00% 15995 15995 0.00%
sqlite u32_u64_str unique_0 1024 1070323 1070323 0.00% 1074157 1074157 0.00%
sqlite u32_u64_str unique_0 64 77973 77973 0.00% 79367 79367 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% 50184 50184 0.00%
64 bsatn 25509 25509 0.00% 27753 27753 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 19436714 19443287 -0.03% 20250812 20252453 -0.01%
stdb_raw u32_u64_str unique_0 64 128 1261837 1261327 0.04% 1345343 1344625 0.05%
sqlite u32_u64_str unique_0 1024 1024 1809743 1809743 0.00% 1818265 1818265 0.00%
sqlite u32_u64_str unique_0 64 128 132654 132654 0.00% 135580 135580 0.00%

Please sign in to comment.