Skip to content

Commit

Permalink
Websocket API: Light transaction updates & NoSuccessNotify (#1812)
Browse files Browse the repository at this point in the history
Signed-off-by: Mazdak Farrokhzad <twingoow@gmail.com>
Co-authored-by: Phoebe Goldman <phoebe@clockworklabs.io>
  • Loading branch information
Centril and gefjon authored Nov 4, 2024
1 parent 1657fd2 commit ac0053c
Show file tree
Hide file tree
Showing 195 changed files with 4,401 additions and 186 deletions.
28 changes: 24 additions & 4 deletions crates/cli/src/subcommands/generate/csharp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ fn default_init(ctx: &GenCtx, ty: &AlgebraicType) -> Option<&'static str> {
AlgebraicType::Sum(sum_type) if sum_type.is_option() || sum_type.is_simple_enum() => None,
// TODO: generate some proper default here (what would it be for tagged enums?).
AlgebraicType::Sum(_) => Some("null!"),
// For product types, arrays, and maps, we can use the default constructor.
// For product types and arrays, we can use the default constructor.
AlgebraicType::Product(_) | AlgebraicType::Array(_) => Some("new()"),
// Strings must have explicit default value of "".
AlgebraicType::String => Some(r#""""#),
Expand Down Expand Up @@ -641,7 +641,11 @@ pub fn autogen_csharp_globals(ctx: &GenCtx, items: &[GenItem], namespace: &str)

writeln!(output, "public sealed class RemoteReducers : RemoteBase<DbConnection>");
indented_block(&mut output, |output| {
writeln!(output, "internal RemoteReducers(DbConnection conn) : base(conn) {{}}");
writeln!(
output,
"internal RemoteReducers(DbConnection conn, SetReducerFlags SetReducerFlags) : base(conn) {{ this.SetCallReducerFlags = SetReducerFlags; }}"
);
writeln!(output, "internal readonly SetReducerFlags SetCallReducerFlags;");

for reducer in &reducers {
let func_name = &*reducer.name;
Expand Down Expand Up @@ -683,7 +687,7 @@ pub fn autogen_csharp_globals(ctx: &GenCtx, items: &[GenItem], namespace: &str)
indented_block(output, |output| {
writeln!(
output,
"conn.InternalCallReducer(new {func_name_pascal_case} {{ {field_inits} }});"
"conn.InternalCallReducer(new {func_name_pascal_case} {{ {field_inits} }}, this.SetCallReducerFlags.{func_name_pascal_case}Flags);"
);
});
writeln!(output);
Expand Down Expand Up @@ -716,12 +720,25 @@ pub fn autogen_csharp_globals(ctx: &GenCtx, items: &[GenItem], namespace: &str)
});
writeln!(output);

writeln!(output, "public sealed class SetReducerFlags");
indented_block(&mut output, |output| {
writeln!(output, "internal SetReducerFlags() {{ }}");
for reducer in &reducers {
let func_name = &*reducer.name;
let func_name_pascal_case = func_name.to_case(Case::Pascal);
writeln!(output, "internal CallReducerFlags {func_name_pascal_case}Flags;");
writeln!(output, "public void {func_name_pascal_case}(CallReducerFlags flags) {{ this.{func_name_pascal_case}Flags = flags; }}");
}
});
writeln!(output);

writeln!(
output,
"public partial record EventContext : DbContext<RemoteTables>, IEventContext"
);
indented_block(&mut output, |output| {
writeln!(output, "public readonly RemoteReducers Reducers;");
writeln!(output, "public readonly SetReducerFlags SetReducerFlags;");
writeln!(output, "public readonly Event<Reducer> Event;");
writeln!(output);
writeln!(
Expand All @@ -730,6 +747,7 @@ pub fn autogen_csharp_globals(ctx: &GenCtx, items: &[GenItem], namespace: &str)
);
indented_block(output, |output| {
writeln!(output, "Reducers = conn.Reducers;");
writeln!(output, "SetReducerFlags = conn.SetReducerFlags;");
writeln!(output, "Event = reducerEvent;");
});
});
Expand All @@ -755,11 +773,13 @@ pub fn autogen_csharp_globals(ctx: &GenCtx, items: &[GenItem], namespace: &str)
indented_block(&mut output, |output| {
writeln!(output, "public readonly RemoteTables Db = new();");
writeln!(output, "public readonly RemoteReducers Reducers;");
writeln!(output, "public readonly SetReducerFlags SetReducerFlags;");
writeln!(output);

writeln!(output, "public DbConnection()");
indented_block(output, |output| {
writeln!(output, "Reducers = new(this);");
writeln!(output, "SetReducerFlags = new();");
writeln!(output, "Reducers = new(this, this.SetReducerFlags);");
writeln!(output);

for item in items {
Expand Down
59 changes: 59 additions & 0 deletions crates/cli/src/subcommands/generate/rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ Requested namespace: {namespace}",

let reducer_name = reducer.name.deref();
let func_name = reducer_function_name(reducer);
let set_reducer_flags_trait = format!("set_flags_for_{func_name}");
let args_type = reducer_args_type_name(&reducer.name);

define_struct_for_product(module, out, &args_type, &reducer.params_for_generate.elements);
Expand Down Expand Up @@ -431,6 +432,26 @@ impl {func_name} for super::RemoteReducers {{
self.imp.remove_on_reducer::<{args_type}>({reducer_name:?}, callback.0)
}}
}}
#[allow(non_camel_case_types)]
#[doc(hidden)]
/// Extension trait for setting the call-flags for the reducer `{reducer_name}`.
///
/// Implemented for [`super::SetReducerFlags`].
///
/// This type is currently unstable and may be removed without a major version bump.
pub trait {set_reducer_flags_trait} {{
/// Set the call-reducer flags for the reducer `{reducer_name}` to `flags`.
///
/// This type is currently unstable and may be removed without a major version bump.
fn {func_name}(&self, flags: __ws::CallReducerFlags);
}}
impl {set_reducer_flags_trait} for super::SetReducerFlags {{
fn {func_name}(&self, flags: __ws::CallReducerFlags) {{
self.imp.set_call_reducer_flags({reducer_name:?}, flags);
}}
}}
"
);

Expand Down Expand Up @@ -985,6 +1006,7 @@ impl __sdk::spacetime_module::SpacetimeModule for RemoteModule {{
type Reducer = Reducer;
type DbView = RemoteTables;
type Reducers = RemoteReducers;
type SetReducerFlags = SetReducerFlags;
type DbUpdate = DbUpdate;
type SubscriptionHandle = SubscriptionHandle;
}}
Expand All @@ -999,6 +1021,20 @@ impl __sdk::spacetime_module::InModule for RemoteReducers {{
type Module = RemoteModule;
}}
#[doc(hidden)]
/// The `set_reducer_flags` field of [`DbConnection`],
/// with methods provided by extension traits for each reducer defined by the module.
/// Each method sets the flags for the reducer with the same name.
///
/// This type is currently unstable and may be removed without a major version bump.
pub struct SetReducerFlags {{
imp: __sdk::db_connection::DbContextImpl<RemoteModule>,
}}
impl __sdk::spacetime_module::InModule for SetReducerFlags {{
type Module = RemoteModule;
}}
/// The `db` field of [`EventContext`] and [`DbConnection`],
/// with methods provided by extension traits for each table defined by the module.
pub struct RemoteTables {{
Expand Down Expand Up @@ -1030,6 +1066,12 @@ pub struct DbConnection {{
pub db: RemoteTables,
/// Access to reducers defined by the module via extension traits implemented for [`RemoteReducers`].
pub reducers: RemoteReducers,
#[doc(hidden)]
/// Access to setting the call-flags of each reducer defined for each reducer defined by the module
/// via extension traits implemented for [`SetReducerFlags`].
///
/// This type is currently unstable and may be removed without a major version bump.
pub set_reducer_flags: SetReducerFlags,
imp: __sdk::db_connection::DbContextImpl<RemoteModule>,
}}
Expand All @@ -1041,13 +1083,17 @@ impl __sdk::spacetime_module::InModule for DbConnection {{
impl __sdk::db_context::DbContext for DbConnection {{
type DbView = RemoteTables;
type Reducers = RemoteReducers;
type SetReducerFlags = SetReducerFlags;
fn db(&self) -> &Self::DbView {{
&self.db
}}
fn reducers(&self) -> &Self::Reducers {{
&self.reducers
}}
fn set_reducer_flags(&self) -> &Self::SetReducerFlags {{
&self.set_reducer_flags
}}
fn is_active(&self) -> bool {{
self.imp.is_active()
Expand Down Expand Up @@ -1147,6 +1193,7 @@ impl __sdk::spacetime_module::DbConnection for DbConnection {{
Self {{
db: RemoteTables {{ imp: imp.clone() }},
reducers: RemoteReducers {{ imp: imp.clone() }},
set_reducer_flags: SetReducerFlags {{ imp: imp.clone() }},
imp,
}}
}}
Expand All @@ -1159,6 +1206,11 @@ pub struct EventContext {{
pub db: RemoteTables,
/// Access to reducers defined by the module via extension traits implemented for [`RemoteReducers`].
pub reducers: RemoteReducers,
/// Access to setting the call-flags of each reducer defined for each reducer defined by the module
/// via extension traits implemented for [`SetReducerFlags`].
///
/// This type is currently unstable and may be removed without a major version bump.
pub set_reducer_flags: SetReducerFlags,
/// The event which caused these callbacks to run.
pub event: __sdk::event::Event<Reducer>,
imp: __sdk::db_connection::DbContextImpl<RemoteModule>,
Expand All @@ -1171,13 +1223,17 @@ impl __sdk::spacetime_module::InModule for EventContext {{
impl __sdk::db_context::DbContext for EventContext {{
type DbView = RemoteTables;
type Reducers = RemoteReducers;
type SetReducerFlags = SetReducerFlags;
fn db(&self) -> &Self::DbView {{
&self.db
}}
fn reducers(&self) -> &Self::Reducers {{
&self.reducers
}}
fn set_reducer_flags(&self) -> &Self::SetReducerFlags {{
&self.set_reducer_flags
}}
fn is_active(&self) -> bool {{
self.imp.is_active()
Expand Down Expand Up @@ -1209,6 +1265,7 @@ impl __sdk::spacetime_module::EventContext for EventContext {{
Self {{
db: RemoteTables {{ imp: imp.clone() }},
reducers: RemoteReducers {{ imp: imp.clone() }},
set_reducer_flags: SetReducerFlags {{ imp: imp.clone() }},
event,
imp,
}}
Expand Down Expand Up @@ -1239,11 +1296,13 @@ impl __sdk::spacetime_module::SubscriptionHandle for SubscriptionHandle {{
pub trait RemoteDbContext: __sdk::DbContext<
DbView = RemoteTables,
Reducers = RemoteReducers,
SetReducerFlags = SetReducerFlags,
SubscriptionBuilder = __sdk::subscription::SubscriptionBuilder<RemoteModule>,
> {{}}
impl<Ctx: __sdk::DbContext<
DbView = RemoteTables,
Reducers = RemoteReducers,
SetReducerFlags = SetReducerFlags,
SubscriptionBuilder = __sdk::subscription::SubscriptionBuilder<RemoteModule>,
>> RemoteDbContext for Ctx {{}}
",
Expand Down
44 changes: 37 additions & 7 deletions crates/cli/src/subcommands/generate/typescript.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,11 @@ eventContextConstructor: (imp: DBConnectionImpl, event: Event<Reducer>) => {{
dbViewConstructor: (imp: DBConnectionImpl) => {{
return new RemoteTables(imp);
}},
reducersConstructor: (imp: DBConnectionImpl) => {{
return new RemoteReducers(imp);
reducersConstructor: (imp: DBConnectionImpl, setReducerFlags: SetReducerFlags) => {{
return new RemoteReducers(imp, setReducerFlags);
}},
setReducerFlagsConstructor: () => {{
return new SetReducerFlags();
}}"
);
out.dedent(1);
Expand All @@ -405,6 +408,10 @@ reducersConstructor: (imp: DBConnectionImpl) => {{

out.newline();

print_set_reducer_flags(module, out);

out.newline();

print_remote_tables(module, out);

out.newline();
Expand All @@ -415,7 +422,7 @@ reducersConstructor: (imp: DBConnectionImpl) => {{

writeln!(
out,
"export type EventContext = EventContextInterface<RemoteTables, RemoteReducers, Reducer>;"
"export type EventContext = EventContextInterface<RemoteTables, RemoteReducers, SetReducerFlags, Reducer>;"
);

vec![("index.ts".to_string(), (output.into_inner()))]
Expand All @@ -425,7 +432,10 @@ reducersConstructor: (imp: DBConnectionImpl) => {{
fn print_remote_reducers(module: &ModuleDef, out: &mut Indenter) {
writeln!(out, "export class RemoteReducers {{");
out.indent(1);
writeln!(out, "constructor(private connection: DBConnectionImpl) {{}}");
writeln!(
out,
"constructor(private connection: DBConnectionImpl, private setCallReducerFlags: SetReducerFlags) {{}}"
);
out.newline();

for reducer in iter_reducers(module) {
Expand Down Expand Up @@ -455,7 +465,7 @@ fn print_remote_reducers(module: &ModuleDef, out: &mut Indenter) {
out.with_indent(|out| {
writeln!(
out,
"this.connection.callReducer(\"{reducer_name}\", new Uint8Array(0));"
"this.connection.callReducer(\"{reducer_name}\", new Uint8Array(0), this.setCallReducerFlags.{reducer_function_name}Flags);"
);
});
} else {
Expand All @@ -468,7 +478,7 @@ fn print_remote_reducers(module: &ModuleDef, out: &mut Indenter) {
"{reducer_variant}.getTypeScriptAlgebraicType().serialize(__writer, __args);"
);
writeln!(out, "let __argsBuffer = __writer.getBuffer();");
writeln!(out, "this.connection.callReducer(\"{reducer_name}\", __argsBuffer);");
writeln!(out, "this.connection.callReducer(\"{reducer_name}\", __argsBuffer, this.setCallReducerFlags.{reducer_function_name}Flags);");
});
}
writeln!(out, "}}");
Expand Down Expand Up @@ -503,6 +513,25 @@ fn print_remote_reducers(module: &ModuleDef, out: &mut Indenter) {
writeln!(out, "}}");
}

fn print_set_reducer_flags(module: &ModuleDef, out: &mut Indenter) {
writeln!(out, "export class SetReducerFlags {{");
out.indent(1);

for reducer in iter_reducers(module) {
let reducer_function_name = reducer_function_name(reducer);
writeln!(out, "{reducer_function_name}Flags: CallReducerFlags = 'FullUpdate';");
writeln!(out, "{reducer_function_name}(flags: CallReducerFlags) {{");
out.with_indent(|out| {
writeln!(out, "this.{reducer_function_name}Flags = flags;");
});
writeln!(out, "}}");
out.newline();
}

out.dedent(1);
writeln!(out, "}}");
}

fn print_remote_tables(module: &ModuleDef, out: &mut Indenter) {
writeln!(out, "export class RemoteTables {{");
out.indent(1);
Expand Down Expand Up @@ -533,7 +562,7 @@ fn print_remote_tables(module: &ModuleDef, out: &mut Indenter) {
fn print_db_connection(_module: &ModuleDef, out: &mut Indenter) {
writeln!(
out,
"export class DBConnection extends DBConnectionImpl<RemoteTables, RemoteReducers> {{"
"export class DBConnection extends DBConnectionImpl<RemoteTables, RemoteReducers, SetReducerFlags> {{"
);
out.indent(1);
writeln!(out, "static builder = (): DBConnectionBuilder<DBConnection> => {{");
Expand Down Expand Up @@ -575,6 +604,7 @@ fn print_spacetimedb_imports(out: &mut Indenter) {
"DBConnectionBuilder",
"TableCache",
"BinaryWriter",
"CallReducerFlags",
"EventContextInterface",
"BinaryReader",
"DBConnectionImpl",
Expand Down
17 changes: 10 additions & 7 deletions crates/cli/src/subcommands/subscribe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ where
S: TryStream<Ok = WsMessage> + Unpin,
S::Error: std::error::Error + Send + Sync + 'static,
{
const RECV_TX_UPDATE: &str = "protocol error: received transaction update before initial subscription update";

while let Some(msg) = ws.try_next().await? {
let Some(msg) = parse_msg_json(&msg) else { continue };
match msg {
Expand All @@ -207,12 +209,12 @@ where
}
break;
}
ws::ServerMessage::TransactionUpdate(ws::TransactionUpdate { status, .. }) => {
let message = match status {
ws::UpdateStatus::Failed(msg) => msg,
_ => "protocol error: received transaction update before initial subscription update".into(),
};
anyhow::bail!(message)
ws::ServerMessage::TransactionUpdate(ws::TransactionUpdate { status, .. }) => anyhow::bail!(match status {
ws::UpdateStatus::Failed(msg) => msg,
_ => RECV_TX_UPDATE.into(),
}),
ws::ServerMessage::TransactionUpdateLight(ws::TransactionUpdateLight { .. }) => {
anyhow::bail!(RECV_TX_UPDATE)
}
_ => continue,
}
Expand Down Expand Up @@ -248,7 +250,8 @@ where
ws::ServerMessage::InitialSubscription(_) => {
anyhow::bail!("protocol error: received a second initial subscription update")
}
ws::ServerMessage::TransactionUpdate(ws::TransactionUpdate {
ws::ServerMessage::TransactionUpdateLight(ws::TransactionUpdateLight { update, .. })
| ws::ServerMessage::TransactionUpdate(ws::TransactionUpdate {
status: ws::UpdateStatus::Committed(update),
..
}) => {
Expand Down
Loading

2 comments on commit ac0053c

@github-actions
Copy link

@github-actions github-actions bot commented on ac0053c Nov 4, 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 ac0053c Nov 4, 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 6364 6364 0.00% 6460 6460 0.00%
sqlite 5579 5579 0.00% 6001 6051 -0.83%

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 76559 76559 0.00% 77059 77155 -0.12%
stdb_raw u32_u64_str no_index 64 128 2 string 120146 120167 -0.02% 120884 120981 -0.08%
stdb_raw u32_u64_str btree_each_column 64 128 2 string 25048 25049 -0.00% 25622 25751 -0.50%
stdb_raw u32_u64_str btree_each_column 64 128 1 u64 24016 24016 0.00% 24456 24524 -0.28%
sqlite u32_u64_str no_index 64 128 2 string 144695 144695 0.00% 146075 146255 -0.12%
sqlite u32_u64_str no_index 64 128 1 u64 124044 124044 0.00% 125270 125342 -0.06%
sqlite u32_u64_str btree_each_column 64 128 1 u64 131394 131361 0.03% 132780 132895 -0.09%
sqlite u32_u64_str btree_each_column 64 128 2 string 134494 134494 0.00% 136050 136154 -0.08%

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 876679 876056 0.07% 896611 900644 -0.45%
stdb_raw u32_u64_str btree_each_column 64 128 1026965 1028809 -0.18% 1054209 1062649 -0.79%
sqlite u32_u64_str unique_0 64 128 398326 398320 0.00% 415084 413542 0.37%
sqlite u32_u64_str btree_each_column 64 128 983637 983637 0.00% 1020751 1017391 0.33%

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 153691 153691 0.00% 153773 153773 0.00%
stdb_raw u32_u64_str unique_0 64 16716 16716 0.00% 16778 16778 0.00%
sqlite u32_u64_str unique_0 1024 1067255 1067255 0.00% 1070583 1070547 0.00%
sqlite u32_u64_str unique_0 64 76201 76201 0.00% 77259 77235 0.03%

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% 50146 50146 0.00%
64 bsatn 25509 25509 0.00% 27719 27719 0.00%
16 bsatn 8200 8200 0.00% 9526 9526 0.00%
16 json 12188 12188 0.00% 14058 14058 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 20505695 20109666 1.97% 20985129 20722692 1.27%
stdb_raw u32_u64_str unique_0 64 128 1285311 1286651 -0.10% 1319221 1331407 -0.92%
sqlite u32_u64_str unique_0 1024 1024 1802182 1802182 0.00% 1811320 1811438 -0.01%
sqlite u32_u64_str unique_0 64 128 128528 128528 0.00% 131398 131438 -0.03%
On-disk benchmarks

callgrind: empty transaction

db total reads + writes old total reads + writes Δrw estimated cycles old estimated cycles Δcycles
stdb_raw 6369 6369 0.00% 6473 6473 0.00%
sqlite 5621 5621 0.00% 6099 6149 -0.81%

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 76564 76564 0.00% 77036 77120 -0.11%
stdb_raw u32_u64_str no_index 64 128 2 string 119062 119062 0.00% 119856 119804 0.04%
stdb_raw u32_u64_str btree_each_column 64 128 2 string 25069 25053 0.06% 25595 25711 -0.45%
stdb_raw u32_u64_str btree_each_column 64 128 1 u64 24021 24021 0.00% 24433 24493 -0.24%
sqlite u32_u64_str no_index 64 128 1 u64 125965 125965 0.00% 127459 127539 -0.06%
sqlite u32_u64_str no_index 64 128 2 string 146616 146616 0.00% 148312 148448 -0.09%
sqlite u32_u64_str btree_each_column 64 128 2 string 136616 136616 0.00% 138682 138750 -0.05%
sqlite u32_u64_str btree_each_column 64 128 1 u64 133457 133457 0.00% 135301 135317 -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 826719 826614 0.01% 876629 881292 -0.53%
stdb_raw u32_u64_str btree_each_column 64 128 974136 977318 -0.33% 1000692 1041426 -3.91%
sqlite u32_u64_str unique_0 64 128 415857 415857 0.00% 431839 430493 0.31%
sqlite u32_u64_str btree_each_column 64 128 1021898 1021898 0.00% 1057814 1054456 0.32%

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 153696 153696 0.00% 153754 153758 -0.00%
stdb_raw u32_u64_str unique_0 64 16721 16721 0.00% 16779 16779 0.00%
sqlite u32_u64_str unique_0 1024 1070323 1070323 0.00% 1074081 1074097 -0.00%
sqlite u32_u64_str unique_0 64 77991 77973 0.02% 79305 79387 -0.10%

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% 50146 50146 0.00%
64 bsatn 25509 25509 0.00% 27719 27719 0.00%
16 bsatn 8200 8200 0.00% 9526 9526 0.00%
16 json 12188 12188 0.00% 14058 14058 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 19025133 19028269 -0.02% 19532411 19717597 -0.94%
stdb_raw u32_u64_str unique_0 64 128 1239359 1238844 0.04% 1302409 1313796 -0.87%
sqlite u32_u64_str unique_0 1024 1024 1809743 1809743 0.00% 1818389 1818399 -0.00%
sqlite u32_u64_str unique_0 64 128 132654 132654 0.00% 135640 135696 -0.04%

Please sign in to comment.