Skip to content

Commit

Permalink
CLI - Stabilize spacetime server subcommands (#1845)
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 c98fe97 commit 70ab143
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 35 deletions.
69 changes: 41 additions & 28 deletions crates/cli/src/subcommands/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,18 @@ fn get_subcommands() -> Vec<Command> {
Command::new("set-default")
.about("Set the default server for future operations")
.arg(
common_args::server()
Arg::new("server")
.help("The nickname, host name or URL of the new default server")
.required(true),
),
Command::new("add")
.about("Add a new server configuration")
.arg(Arg::new("url").help("The URL of the server to add").required(true))
.arg(
Arg::new("url")
.long("url")
.help("The URL of the server to add")
.required(true),
)
.arg(Arg::new("name").help("Nickname for this server").required(true))
.arg(
Arg::new("default")
Expand All @@ -50,7 +55,7 @@ fn get_subcommands() -> Vec<Command> {
Command::new("remove")
.about("Remove a saved server configuration")
.arg(
common_args::server()
Arg::new("server")
.help("The nickname, host name or URL of the server to remove")
.required(true),
)
Expand All @@ -64,7 +69,11 @@ fn get_subcommands() -> Vec<Command> {
.arg(common_args::yes()),
Command::new("fingerprint")
.about("Show or update a saved server's fingerprint")
.arg(common_args::server().help("The nickname, host name or URL of the server"))
.arg(
Arg::new("server")
.required(true)
.help("The nickname, host name or URL of the server"),
)
.arg(common_args::yes())
.arg(
Arg::new("delete-obsolete-identities")
Expand All @@ -75,27 +84,27 @@ fn get_subcommands() -> Vec<Command> {
),
Command::new("ping")
.about("Checks to see if a SpacetimeDB host is online")
.arg(common_args::server().help("The nickname, host name or URL of the server to ping")),
.arg(
Arg::new("server")
.required(true)
.help("The nickname, host name or URL of the server to ping"),
),
Command::new("edit")
.about("Update a saved server's nickname, host name or protocol")
.arg(common_args::server().help("The nickname, host name or URL of the server"))
.arg(
Arg::new("nickname")
.help("A new nickname to assign the server configuration")
.short('n')
.long("nickname"),
Arg::new("server")
.required(true)
.help("The nickname, host name or URL of the server"),
)
.arg(
Arg::new("host")
.help("A new hostname to assign the server configuration")
.short('H')
.long("host"),
Arg::new("nickname")
.help("A new nickname to assign the server configuration")
.long("new-name"),
)
.arg(
Arg::new("protocol")
.help("A new protocol to assign the server configuration; http or https")
.short('p')
.long("protocol"),
Arg::new("url")
.long("url")
.help("A new URL to assign the server configuration"),
)
.arg(
Arg::new("no-fingerprint")
Expand Down Expand Up @@ -322,11 +331,11 @@ async fn update_server_fingerprint(
}

pub async fn exec_fingerprint(mut config: Config, args: &ArgMatches) -> Result<(), anyhow::Error> {
let server = args.get_one::<String>("server").map(|s| s.as_str());
let server = args.get_one::<String>("server").unwrap().as_str();
let delete_identities = args.get_flag("delete-obsolete-identities");
let force = args.get_flag("force");

if update_server_fingerprint(&mut config, server, delete_identities).await? {
if update_server_fingerprint(&mut config, Some(server), delete_identities).await? {
if !y_or_n(force, "Continue?")? {
anyhow::bail!("Aborted");
}
Expand All @@ -338,8 +347,8 @@ pub async fn exec_fingerprint(mut config: Config, args: &ArgMatches) -> Result<(
}

pub async fn exec_ping(config: Config, args: &ArgMatches) -> Result<(), anyhow::Error> {
let server = args.get_one::<String>("server").map(|s| s.as_ref());
let url = config.get_host_url(server)?;
let server = args.get_one::<String>("server").unwrap().as_str();
let url = config.get_host_url(Some(server))?;

let builder = reqwest::Client::new().get(format!("{}/database/ping", url).as_str());
let response = builder.send().await?;
Expand All @@ -359,16 +368,20 @@ pub async fn exec_ping(config: Config, args: &ArgMatches) -> Result<(), anyhow::
}

pub async fn exec_edit(mut config: Config, args: &ArgMatches) -> Result<(), anyhow::Error> {
let server = args
.get_one::<String>("server")
.map(|s| s.as_str())
.expect("Supply a server to spacetime server edit");
let server = args.get_one::<String>("server").unwrap().as_str();

let old_url = config.get_host_url(Some(server))?;

let new_nick = args.get_one::<String>("nickname").map(|s| s.as_str());
let new_host = args.get_one::<String>("host").map(|s| s.as_str());
let new_proto = args.get_one::<String>("protocol").map(|s| s.as_str());
let new_url = args.get_one::<String>("url").map(|s| s.as_str());
let (new_host, new_proto) = match new_url {
None => (None, None),
Some(new_url) => {
let (new_host, new_proto) = host_or_url_to_host_and_protocol(new_url);
let new_proto = new_proto.ok_or_else(|| anyhow::anyhow!("Invalid url: {}", new_url))?;
(Some(new_host), Some(new_proto))
}
};

let no_fingerprint = args.get_flag("no-fingerprint");
let delete_identities = args.get_flag("delete-obsolete-identities");
Expand Down
2 changes: 1 addition & 1 deletion smoketests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def reset_config(cls):

def fingerprint(self):
# Fetch the server's fingerprint; required for `identity list`.
self.spacetime("server", "fingerprint", "-s", "localhost", "-y")
self.spacetime("server", "fingerprint", "localhost", "-y")

def new_identity(self, *, default=False):
output = self.spacetime("identity", "new")
Expand Down
12 changes: 6 additions & 6 deletions smoketests/tests/servers.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,28 @@ class Servers(Smoketest):
def test_servers(self):
"""Verify that we can add and list server configurations"""

out = self.spacetime("server", "add", "https://testnet.spacetimedb.com", "testnet", "--no-fingerprint")
out = self.spacetime("server", "add", "--url", "https://testnet.spacetimedb.com", "testnet", "--no-fingerprint")
self.assertEqual(extract_field(out, "Host:"), "testnet.spacetimedb.com")
self.assertEqual(extract_field(out, "Protocol:"), "https")

servers = self.spacetime("server", "list")
self.assertRegex(servers, re.compile(r"^\s*testnet\.spacetimedb\.com\s+https\s+testnet\s*$", re.M))
self.assertRegex(servers, re.compile(r"^\s*\*\*\*\s+127\.0\.0\.1:3000\s+http\s+localhost\s*$", re.M))

out = self.spacetime("server", "fingerprint", "-s", "http://127.0.0.1:3000", "-y")
out = self.spacetime("server", "fingerprint", "http://127.0.0.1:3000", "-y")
self.assertIn("No saved fingerprint for server 127.0.0.1:3000.", out)

out = self.spacetime("server", "fingerprint", "-s", "http://127.0.0.1:3000")
out = self.spacetime("server", "fingerprint", "http://127.0.0.1:3000")
self.assertIn("Fingerprint is unchanged for server 127.0.0.1:3000", out)

out = self.spacetime("server", "fingerprint", "-s", "localhost")
out = self.spacetime("server", "fingerprint", "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")
out = self.spacetime("server", "add", "--url", "https://foo.com", "foo", "--no-fingerprint")
out = self.spacetime("server", "edit", "foo", "--url", "https://edited-testnet.spacetimedb.com", "--new-name", "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 70ab143

@github-actions
Copy link

@github-actions github-actions bot commented on 70ab143 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.5±1.92ns 410.7±1.13ns - -
sqlite 🧠 400.0±3.67ns 407.0±1.34ns - -
stdb_raw 💿 627.4±0.37ns 627.6±0.31ns - -
stdb_raw 🧠 623.1±0.75ns 627.6±0.70ns - -

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 580.2±0.91µs 582.1±0.80µs 1723 tx/sec 1717 tx/sec
sqlite 💿 u32_u64_str unique_0 2048 256 148.6±0.60µs 149.5±0.52µs 6.6 Ktx/sec 6.5 Ktx/sec
sqlite 💿 u32_u64_u64 btree_each_column 2048 256 462.7±1.52µs 463.6±0.64µs 2.1 Ktx/sec 2.1 Ktx/sec
sqlite 💿 u32_u64_u64 unique_0 2048 256 141.2±20.35µs 135.7±0.53µs 6.9 Ktx/sec 7.2 Ktx/sec
sqlite 🧠 u32_u64_str btree_each_column 2048 256 442.7±1.06µs 442.5±0.34µs 2.2 Ktx/sec 2.2 Ktx/sec
sqlite 🧠 u32_u64_str unique_0 2048 256 119.9±0.62µs 121.4±0.74µs 8.1 Ktx/sec 8.0 Ktx/sec
sqlite 🧠 u32_u64_u64 btree_each_column 2048 256 361.8±0.53µs 359.4±0.31µs 2.7 Ktx/sec 2.7 Ktx/sec
sqlite 🧠 u32_u64_u64 unique_0 2048 256 105.6±0.53µs 106.5±0.55µs 9.3 Ktx/sec 9.2 Ktx/sec
stdb_raw 💿 u32_u64_str btree_each_column 2048 256 645.1±16.98µs 640.3±27.70µs 1550 tx/sec 1561 tx/sec
stdb_raw 💿 u32_u64_str unique_0 2048 256 499.4±17.80µs 433.6±41.31µs 2002 tx/sec 2.3 Ktx/sec
stdb_raw 💿 u32_u64_u64 btree_each_column 2048 256 336.4±7.34µs 380.3±7.52µs 2.9 Ktx/sec 2.6 Ktx/sec
stdb_raw 💿 u32_u64_u64 unique_0 2048 256 346.0±17.87µs 351.4±9.12µs 2.8 Ktx/sec 2.8 Ktx/sec
stdb_raw 🧠 u32_u64_str btree_each_column 2048 256 308.6±0.21µs 307.3±0.34µs 3.2 Ktx/sec 3.2 Ktx/sec
stdb_raw 🧠 u32_u64_str unique_0 2048 256 240.8±0.23µs 241.7±0.25µs 4.1 Ktx/sec 4.0 Ktx/sec
stdb_raw 🧠 u32_u64_u64 btree_each_column 2048 256 244.3±0.13µs 244.7±0.13µs 4.0 Ktx/sec 4.0 Ktx/sec
stdb_raw 🧠 u32_u64_u64 unique_0 2048 256 219.0±0.40µs 219.4±0.31µ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 21.2±0.15µs 22.8±0.26µs 46.0 Ktx/sec 42.8 Ktx/sec
sqlite 💿 u32_u64_u64 unique_0 20.0±0.16µs 21.9±0.36µs 48.9 Ktx/sec 44.7 Ktx/sec
sqlite 🧠 u32_u64_str unique_0 18.5±0.10µs 20.1±0.09µs 52.7 Ktx/sec 48.5 Ktx/sec
sqlite 🧠 u32_u64_u64 unique_0 17.3±0.13µs 18.8±0.22µs 56.5 Ktx/sec 51.9 Ktx/sec
stdb_raw 💿 u32_u64_str unique_0 4.0±0.00µs 4.8±0.00µs 243.9 Ktx/sec 203.9 Ktx/sec
stdb_raw 💿 u32_u64_u64 unique_0 3.9±0.00µs 4.7±0.00µs 252.1 Ktx/sec 209.7 Ktx/sec
stdb_raw 🧠 u32_u64_str unique_0 4.0±0.00µs 4.8±0.00µs 244.0 Ktx/sec 204.3 Ktx/sec
stdb_raw 🧠 u32_u64_u64 unique_0 3.9±0.00µs 4.7±0.00µs 252.2 Ktx/sec 209.7 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 67.0±0.11µs 71.0±0.44µs 14.6 Ktx/sec 13.7 Ktx/sec
sqlite 💿 u64 index 2048 256 64.5±0.05µs 66.8±0.26µs 15.1 Ktx/sec 14.6 Ktx/sec
sqlite 🧠 string index 2048 256 63.3±0.12µs 67.0±0.35µs 15.4 Ktx/sec 14.6 Ktx/sec
sqlite 🧠 u64 index 2048 256 58.8±0.15µs 60.4±0.18µs 16.6 Ktx/sec 16.2 Ktx/sec
stdb_raw 💿 string index 2048 256 4.8±0.00µs 4.8±0.00µs 202.4 Ktx/sec 202.7 Ktx/sec
stdb_raw 💿 u64 index 2048 256 4.7±0.00µs 4.7±0.00µs 208.7 Ktx/sec 208.5 Ktx/sec
stdb_raw 🧠 string index 2048 256 4.8±0.00µs 4.8±0.00µs 202.4 Ktx/sec 202.7 Ktx/sec
stdb_raw 🧠 u64 index 2048 256 4.7±0.00µs 4.7±0.00µs 208.7 Ktx/sec 208.8 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.00µs 26.8 Mtx/sec 26.8 Mtx/sec
u32_u64_str bflatn_to_bsatn_slow_path 100 3.1±0.01µs 3.2±0.02µs 30.3 Mtx/sec 30.1 Mtx/sec
u32_u64_str bsatn 100 2.5±0.00µs 2.5±0.01µs 38.5 Mtx/sec 38.2 Mtx/sec
u32_u64_str bsatn 100 39.9±0.21ns 40.3±0.12ns 2.3 Gtx/sec 2.3 Gtx/sec
u32_u64_str json 100 5.0±0.09µs 5.2±0.02µs 19.0 Mtx/sec 18.4 Mtx/sec
u32_u64_str json 100 7.5±0.01µs 8.0±0.01µs 12.7 Mtx/sec 11.9 Mtx/sec
u32_u64_str product_value 100 1017.0±1.30ns 1016.8±0.45ns 93.8 Mtx/sec 93.8 Mtx/sec
u32_u64_u64 bflatn_to_bsatn_fast_path 100 996.2±12.66ns 960.3±6.07ns 95.7 Mtx/sec 99.3 Mtx/sec
u32_u64_u64 bflatn_to_bsatn_slow_path 100 2.4±0.01µs 2.4±0.02µs 39.9 Mtx/sec 39.8 Mtx/sec
u32_u64_u64 bsatn 100 1832.0±32.60ns 1715.6±34.02ns 52.1 Mtx/sec 55.6 Mtx/sec
u32_u64_u64 bsatn 100 28.4±0.13ns 38.7±0.11ns 3.3 Gtx/sec 2.4 Gtx/sec
u32_u64_u64 json 100 3.6±0.07µs 3.4±0.07µs 26.4 Mtx/sec 27.8 Mtx/sec
u32_u64_u64 json 100 5.0±0.01µs 4.9±0.00µs 19.2 Mtx/sec 19.5 Mtx/sec
u32_u64_u64 product_value 100 1011.8±1.27ns 1013.3±1.71ns 94.3 Mtx/sec 94.1 Mtx/sec
u64_u64_u32 bflatn_to_bsatn_fast_path 100 726.5±2.74ns 709.0±1.44ns 131.3 Mtx/sec 134.5 Mtx/sec
u64_u64_u32 bflatn_to_bsatn_slow_path 100 2.4±0.01µs 2.4±0.02µs 39.8 Mtx/sec 39.2 Mtx/sec
u64_u64_u32 bsatn 100 1078.2±0.68ns 1078.6±0.74ns 88.5 Mtx/sec 88.4 Mtx/sec
u64_u64_u32 bsatn 100 1828.4±33.20ns 1701.3±31.17ns 52.2 Mtx/sec 56.1 Mtx/sec
u64_u64_u32 json 100 3.3±0.05µs 3.4±0.13µs 28.5 Mtx/sec 27.7 Mtx/sec
u64_u64_u32 json 100 5.1±0.01µs 5.3±0.01µs 18.7 Mtx/sec 17.9 Mtx/sec
u64_u64_u32 product_value 100 1013.5±0.40ns 1014.6±0.48ns 94.1 Mtx/sec 94.0 Mtx/sec

stdb_module_large_arguments

arg size new latency old latency new throughput old throughput
64KiB 104.5±8.21µs 108.9±7.02µs - -

stdb_module_print_bulk

line count new latency old latency new throughput old throughput
1 44.7±4.00µs 56.9±4.64µs - -
100 600.2±6.04µs 599.2±7.12µs - -
1000 4.1±0.86ms 4.6±0.66ms - -

remaining

name new latency old latency new throughput old throughput
special/db_game/circles/load=10 305.6±2.86µs 303.9±1.71µs - -
special/db_game/circles/load=100 304.8±1.63µs 304.9±4.54µ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.5±0.12µs 54.6±0.28µs 17.9 Ktx/sec 17.9 Ktx/sec
sqlite/💿/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 48.1±0.23µs 46.1±0.31µs 20.3 Ktx/sec 21.2 Ktx/sec
sqlite/🧠/update_bulk/u32_u64_str/unique_0/load=2048/count=256 39.9±0.14µs 40.5±0.07µs 24.5 Ktx/sec 24.1 Ktx/sec
sqlite/🧠/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 36.7±0.04µs 34.8±0.11µs 26.6 Ktx/sec 28.1 Ktx/sec
stdb_module/💿/update_bulk/u32_u64_str/unique_0/load=2048/count=256 1275.4±12.20µs 1312.4±57.10µs 784 tx/sec 761 tx/sec
stdb_module/💿/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 1010.5±23.63µs 982.8±49.10µs 989 tx/sec 1017 tx/sec
stdb_raw/💿/update_bulk/u32_u64_str/unique_0/load=2048/count=256 608.4±43.86µs 647.8±18.17µs 1643 tx/sec 1543 tx/sec
stdb_raw/💿/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 492.1±11.69µs 492.3±7.43µs 2032 tx/sec 2031 tx/sec
stdb_raw/🧠/update_bulk/u32_u64_str/unique_0/load=2048/count=256 373.6±0.27µs 376.8±0.54µs 2.6 Ktx/sec 2.6 Ktx/sec
stdb_raw/🧠/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 338.3±0.51µs 340.4±1.78µs 2.9 Ktx/sec 2.9 Ktx/sec

@github-actions
Copy link

@github-actions github-actions bot commented on 70ab143 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% 5465 5469 -0.07%
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% 75962 75966 -0.01%
stdb_raw u32_u64_str no_index 64 128 2 string 118054 118054 0.00% 118570 118570 0.00%
stdb_raw u32_u64_str btree_each_column 64 128 2 string 24080 24080 0.00% 24500 24500 0.00%
stdb_raw u32_u64_str btree_each_column 64 128 1 u64 23048 23048 0.00% 23426 23430 -0.02%
sqlite u32_u64_str no_index 64 128 2 string 144695 144695 0.00% 146071 146067 0.00%
sqlite u32_u64_str no_index 64 128 1 u64 124044 124044 0.00% 125222 125226 -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 136086 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 901761 900681 0.12% 957913 956569 0.14%
stdb_raw u32_u64_str btree_each_column 64 128 1052366 1050276 0.20% 1083164 1112436 -2.63%
sqlite u32_u64_str unique_0 64 128 398320 398320 0.00% 419584 419584 0.00%
sqlite u32_u64_str btree_each_column 64 128 983637 983637 0.00% 1022383 1022367 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% 15994 15990 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 20517367 20948533 -2.06% 21276531 21753833 -2.19%
stdb_raw u32_u64_str unique_0 64 128 1308547 1310724 -0.17% 1362339 1395766 -2.39%
sqlite u32_u64_str unique_0 1024 1024 1802182 1802182 0.00% 1811668 1811668 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 5474 0.00%
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% 118651 118579 0.06%
stdb_raw u32_u64_str btree_each_column 64 128 2 string 24085 24086 -0.00% 24501 24506 -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% 138686 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 849826 850441 -0.07% 905740 906211 -0.05%
stdb_raw u32_u64_str btree_each_column 64 128 1001879 999909 0.20% 1062119 1060247 0.18%
sqlite u32_u64_str unique_0 64 128 415857 415863 -0.00% 436391 436393 -0.00%
sqlite u32_u64_str btree_each_column 64 128 1021898 1021898 0.00% 1061172 1061164 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 1070341 1070323 0.00% 1074187 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 19440426 19436714 0.02% 20249802 20250812 -0.00%
stdb_raw u32_u64_str unique_0 64 128 1262193 1261837 0.03% 1345339 1345343 -0.00%
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.