Skip to content

Commit

Permalink
Small fixes to TypeScript codegen (#1800)
Browse files Browse the repository at this point in the history
  • Loading branch information
cloutiertyler authored Oct 3, 2024
1 parent 46039b5 commit fe62e13
Show file tree
Hide file tree
Showing 2 changed files with 211 additions and 292 deletions.
58 changes: 28 additions & 30 deletions crates/cli/src/subcommands/generate/typescript.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ export class {table_handle} {{
out.with_indent(|out| {
writeln!(out, "for (let row of this.tableCache.iter()) {{");
out.with_indent(|out| {
writeln!(out, "if (row.{unique_field_name} === col_val) {{");
writeln!(out, "if (deepEqual(row.{unique_field_name}, col_val)) {{");
out.with_indent(|out| {
writeln!(out, "return row;");
});
Expand Down Expand Up @@ -350,7 +350,7 @@ Requested namespace: {namespace}",
writeln!(out, "{}: {{", table.name);
out.indent(1);
writeln!(out, "tableName: \"{}\",", table.name);
writeln!(out, "rowType: {row_type}.getAlgebraicType(),");
writeln!(out, "rowType: {row_type}.getTypeScriptAlgebraicType(),");
if let Some(pk) = schema.pk() {
writeln!(out, "primaryKey: \"{}\",", pk.col_name);
}
Expand All @@ -367,7 +367,7 @@ Requested namespace: {namespace}",
writeln!(out, "reducerName: \"{}\",", reducer.name);
writeln!(
out,
"argsType: {args_type}.getAlgebraicType(),",
"argsType: {args_type}.getTypeScriptAlgebraicType(),",
args_type = reducer_args_type_name(&reducer.name)
);
out.dedent(1);
Expand Down Expand Up @@ -463,7 +463,10 @@ fn print_remote_reducers(module: &ModuleDef, out: &mut Indenter) {
out.with_indent(|out| {
writeln!(out, "const __args = {{ {arg_name_list} }};");
writeln!(out, "let __writer = new BinaryWriter(1024);");
writeln!(out, "{reducer_variant}.getAlgebraicType().serialize(__writer, __args);");
writeln!(
out,
"{reducer_variant}.getTypeScriptAlgebraicType().serialize(__writer, __args);"
);
writeln!(out, "let __argsBuffer = __writer.getBuffer();");
writeln!(out, "this.connection.callReducer(\"{reducer_name}\", __argsBuffer);");
});
Expand Down Expand Up @@ -513,10 +516,12 @@ fn print_remote_tables(module: &ModuleDef, out: &mut Indenter) {
let table_handle = table_name_pascalcase.clone() + "TableHandle";
let type_ref = table.product_type_ref;
let row_type = type_ref_name(module, type_ref);
writeln!(out, "#{table_name_camelcase} = this.connection.clientCache.getOrCreateTable<{row_type}>(REMOTE_MODULE.tables.{table_name});");
writeln!(out, "get {table_name_camelcase}(): {table_handle} {{");
out.with_indent(|out| {
writeln!(out, "return new {table_handle}(this.#{table_name_camelcase});");
writeln!(
out,
"return new {table_handle}(this.connection.clientCache.getOrCreateTable<{row_type}>(REMOTE_MODULE.tables.{table_name}));"
);
});
writeln!(out, "}}");
}
Expand Down Expand Up @@ -575,6 +580,7 @@ fn print_spacetimedb_imports(out: &mut Indenter) {
"DBConnectionImpl",
"DBContext",
"Event",
"deepEqual",
];
types.sort();
writeln!(out, "import {{");
Expand Down Expand Up @@ -604,7 +610,7 @@ fn write_get_algebraic_type_for_product(
* This function is derived from the AlgebraicType used to generate this type.
*/"
);
writeln!(out, "export function getAlgebraicType(): AlgebraicType {{");
writeln!(out, "export function getTypeScriptAlgebraicType(): AlgebraicType {{");
{
out.indent(1);
write!(out, "return ");
Expand Down Expand Up @@ -648,30 +654,14 @@ fn define_namespace_and_object_type_for_product(
"export function serialize(writer: BinaryWriter, value: {name}): void {{"
);
out.indent(1);
writeln!(out, "const converted = {{");
out.indent(1);
for (ident, _) in elements {
let name = ident.deref().to_case(Case::Camel);
writeln!(out, "{ident}: value.{name},");
}
out.dedent(1);
writeln!(out, "}};");
writeln!(out, "{name}.getAlgebraicType().serialize(writer, converted);");
writeln!(out, "{name}.getTypeScriptAlgebraicType().serialize(writer, value);");
out.dedent(1);
writeln!(out, "}}");
writeln!(out);

writeln!(out, "export function deserialize(reader: BinaryReader): {name} {{");
out.indent(1);
writeln!(out, "const value = {name}.getAlgebraicType().deserialize(reader);");
writeln!(out, "return {{");
out.indent(1);
for (ident, _) in elements {
let name = ident.deref().to_case(Case::Camel);
writeln!(out, "{name}: value.{ident},");
}
out.dedent(1);
writeln!(out, "}};");
writeln!(out, "return {name}.getTypeScriptAlgebraicType().deserialize(reader);");
out.dedent(1);
writeln!(out, "}}");
writeln!(out);
Expand Down Expand Up @@ -783,7 +773,7 @@ fn write_get_algebraic_type_for_sum(
out: &mut Indenter,
variants: &[(Identifier, AlgebraicTypeUse)],
) {
writeln!(out, "export function getAlgebraicType(): AlgebraicType {{");
writeln!(out, "export function getTypeScriptAlgebraicType(): AlgebraicType {{");
{
indent_scope!(out);
write!(out, "return ");
Expand Down Expand Up @@ -833,15 +823,15 @@ fn define_namespace_and_types_for_sum(
writeln!(
out,
"export function serialize(writer: BinaryWriter, value: {name}): void {{
{name}.getAlgebraicType().serialize(writer, value);
{name}.getTypeScriptAlgebraicType().serialize(writer, value);
}}"
);
writeln!(out);

writeln!(
out,
"export function deserialize(reader: BinaryReader): {name} {{
return {name}.getAlgebraicType().deserialize(reader);
return {name}.getTypeScriptAlgebraicType().deserialize(reader);
}}"
);
writeln!(out);
Expand Down Expand Up @@ -980,7 +970,11 @@ fn convert_algebraic_type<'a>(
convert_algebraic_type(module, out, ty, ref_prefix);
write!(out, ")");
}
AlgebraicTypeUse::Ref(r) => write!(out, "{ref_prefix}{}.getAlgebraicType()", type_ref_name(module, *r)),
AlgebraicTypeUse::Ref(r) => write!(
out,
"{ref_prefix}{}.getTypeScriptAlgebraicType()",
type_ref_name(module, *r)
),
AlgebraicTypeUse::Primitive(prim) => {
write!(out, "AlgebraicType.create{prim:?}Type()");
}
Expand Down Expand Up @@ -1017,7 +1011,11 @@ fn convert_product_type<'a>(
writeln!(out, "AlgebraicType.createProductType([");
out.indent(1);
for (ident, ty) in elements {
write!(out, "new ProductTypeElement(\"{}\", ", ident.deref(),);
write!(
out,
"new ProductTypeElement(\"{}\", ",
ident.deref().to_case(Case::Camel)
);
convert_algebraic_type(module, out, ty, ref_prefix);
writeln!(out, "),");
}
Expand Down
Loading

2 comments on commit fe62e13

@github-actions
Copy link

@github-actions github-actions bot commented on fe62e13 Oct 3, 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 💿 408.7±2.51ns 406.8±3.93ns - -
sqlite 🧠 408.8±1.20ns 403.4±3.12ns - -
stdb_raw 💿 627.3±4.22ns 626.2±1.69ns - -
stdb_raw 🧠 625.6±1.86ns 625.1±0.87ns - -

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 593.8±1.13µs 584.3±0.80µs 1684 tx/sec 1711 tx/sec
sqlite 💿 u32_u64_str unique_0 2048 256 151.9±0.59µs 148.7±0.42µs 6.4 Ktx/sec 6.6 Ktx/sec
sqlite 💿 u32_u64_u64 btree_each_column 2048 256 469.6±0.45µs 464.1±0.43µs 2.1 Ktx/sec 2.1 Ktx/sec
sqlite 💿 u32_u64_u64 unique_0 2048 256 137.4±0.66µs 134.3±0.43µs 7.1 Ktx/sec 7.3 Ktx/sec
sqlite 🧠 u32_u64_str btree_each_column 2048 256 453.4±0.28µs 449.7±0.75µs 2.2 Ktx/sec 2.2 Ktx/sec
sqlite 🧠 u32_u64_str unique_0 2048 256 121.7±0.45µs 121.7±1.30µs 8.0 Ktx/sec 8.0 Ktx/sec
sqlite 🧠 u32_u64_u64 btree_each_column 2048 256 368.9±1.33µs 364.0±0.62µs 2.6 Ktx/sec 2.7 Ktx/sec
sqlite 🧠 u32_u64_u64 unique_0 2048 256 106.8±0.97µs 104.6±0.63µs 9.1 Ktx/sec 9.3 Ktx/sec
stdb_raw 💿 u32_u64_str btree_each_column 2048 256 582.0±44.04µs 522.2±26.94µs 1718 tx/sec 1915 tx/sec
stdb_raw 💿 u32_u64_str unique_0 2048 256 490.7±28.45µs 500.2±27.47µs 2038 tx/sec 1999 tx/sec
stdb_raw 💿 u32_u64_u64 btree_each_column 2048 256 385.7±5.06µs 346.6±6.63µs 2.5 Ktx/sec 2.8 Ktx/sec
stdb_raw 💿 u32_u64_u64 unique_0 2048 256 355.5±13.63µs 357.9±8.88µs 2.7 Ktx/sec 2.7 Ktx/sec
stdb_raw 🧠 u32_u64_str btree_each_column 2048 256 307.9±0.36µs 311.5±1.41µs 3.2 Ktx/sec 3.1 Ktx/sec
stdb_raw 🧠 u32_u64_str unique_0 2048 256 237.4±0.19µs 245.9±0.39µs 4.1 Ktx/sec 4.0 Ktx/sec
stdb_raw 🧠 u32_u64_u64 btree_each_column 2048 256 246.2±0.13µs 254.4±0.10µs 4.0 Ktx/sec 3.8 Ktx/sec
stdb_raw 🧠 u32_u64_u64 unique_0 2048 256 218.8±0.12µs 226.0±0.24µs 4.5 Ktx/sec 4.3 Ktx/sec

iterate

db on disk schema indices new latency old latency new throughput old throughput
sqlite 💿 u32_u64_str unique_0 23.5±0.11µs 22.9±0.18µs 41.6 Ktx/sec 42.6 Ktx/sec
sqlite 💿 u32_u64_u64 unique_0 21.8±0.05µs 21.5±0.17µs 44.9 Ktx/sec 45.3 Ktx/sec
sqlite 🧠 u32_u64_str unique_0 21.0±0.12µs 20.1±0.27µs 46.5 Ktx/sec 48.6 Ktx/sec
sqlite 🧠 u32_u64_u64 unique_0 19.3±0.04µs 18.8±0.17µs 50.7 Ktx/sec 52.0 Ktx/sec
stdb_raw 💿 u32_u64_str unique_0 4.7±0.00µs 4.0±0.00µs 206.3 Ktx/sec 245.9 Ktx/sec
stdb_raw 💿 u32_u64_u64 unique_0 4.6±0.00µs 3.9±0.00µs 210.5 Ktx/sec 252.3 Ktx/sec
stdb_raw 🧠 u32_u64_str unique_0 4.8±0.00µs 4.0±0.00µs 205.6 Ktx/sec 246.3 Ktx/sec
stdb_raw 🧠 u32_u64_u64 unique_0 4.6±0.01µs 3.9±0.00µs 210.3 Ktx/sec 252.3 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 68.5±0.27µs 69.6±0.17µs 14.3 Ktx/sec 14.0 Ktx/sec
sqlite 💿 u64 index 2048 256 66.4±0.20µs 65.9±0.23µs 14.7 Ktx/sec 14.8 Ktx/sec
sqlite 🧠 string index 2048 256 64.7±0.25µs 66.1±0.08µs 15.1 Ktx/sec 14.8 Ktx/sec
sqlite 🧠 u64 index 2048 256 60.5±0.35µs 59.5±0.25µs 16.1 Ktx/sec 16.4 Ktx/sec
stdb_raw 💿 string index 2048 256 4.9±0.00µs 4.9±0.00µs 198.9 Ktx/sec 198.0 Ktx/sec
stdb_raw 💿 u64 index 2048 256 4.7±0.00µs 4.8±0.00µs 207.7 Ktx/sec 204.7 Ktx/sec
stdb_raw 🧠 string index 2048 256 4.9±0.00µs 4.9±0.00µs 198.9 Ktx/sec 198.1 Ktx/sec
stdb_raw 🧠 u64 index 2048 256 4.7±0.00µs 4.8±0.00µs 207.7 Ktx/sec 204.7 Ktx/sec

serialize

schema format count new latency old latency new throughput old throughput
u32_u64_str bflatn_to_bsatn_fast_path 100 3.2±0.02µs 3.3±0.01µs 29.4 Mtx/sec 29.2 Mtx/sec
u32_u64_str bflatn_to_bsatn_slow_path 100 3.0±0.01µs 3.0±0.01µs 31.8 Mtx/sec 31.4 Mtx/sec
u32_u64_str bsatn 100 2.3±0.00µs 2.4±0.02µs 41.1 Mtx/sec 40.0 Mtx/sec
u32_u64_str bsatn 100 40.5±0.03ns 40.5±0.05ns 2.3 Gtx/sec 2.3 Gtx/sec
u32_u64_str json 100 4.7±0.06µs 5.6±0.03µs 20.4 Mtx/sec 16.9 Mtx/sec
u32_u64_str json 100 8.4±0.02µs 8.2±0.01µs 11.4 Mtx/sec 11.6 Mtx/sec
u32_u64_str product_value 100 1018.3±0.52ns 1015.5±0.54ns 93.6 Mtx/sec 93.9 Mtx/sec
u32_u64_u64 bflatn_to_bsatn_fast_path 100 1188.7±3.43ns 1163.1±5.24ns 80.2 Mtx/sec 82.0 Mtx/sec
u32_u64_u64 bflatn_to_bsatn_slow_path 100 2.5±0.01µs 2.5±0.00µs 37.9 Mtx/sec 38.8 Mtx/sec
u32_u64_u64 bsatn 100 1644.1±1.72ns 1651.3±44.87ns 58.0 Mtx/sec 57.8 Mtx/sec
u32_u64_u64 bsatn 100 39.3±0.08ns 39.4±0.08ns 2.4 Gtx/sec 2.4 Gtx/sec
u32_u64_u64 json 100 3.1±0.05µs 3.3±0.04µs 30.7 Mtx/sec 28.9 Mtx/sec
u32_u64_u64 json 100 5.1±0.05µs 4.9±0.01µs 18.6 Mtx/sec 19.5 Mtx/sec
u32_u64_u64 product_value 100 1013.2±1.59ns 1014.4±1.67ns 94.1 Mtx/sec 94.0 Mtx/sec
u64_u64_u32 bflatn_to_bsatn_fast_path 100 892.4±2.01ns 921.5±1.02ns 106.9 Mtx/sec 103.5 Mtx/sec
u64_u64_u32 bflatn_to_bsatn_slow_path 100 2.5±0.00µs 2.5±0.03µs 38.3 Mtx/sec 38.7 Mtx/sec
u64_u64_u32 bsatn 100 1655.7±32.22ns 1663.1±38.50ns 57.6 Mtx/sec 57.3 Mtx/sec
u64_u64_u32 bsatn 100 749.6±0.38ns 706.4±2.84ns 127.2 Mtx/sec 135.0 Mtx/sec
u64_u64_u32 json 100 3.1±0.04µs 3.4±0.08µs 31.3 Mtx/sec 28.4 Mtx/sec
u64_u64_u32 json 100 4.8±0.00µs 5.0±0.01µs 19.8 Mtx/sec 19.1 Mtx/sec
u64_u64_u32 product_value 100 1014.0±0.42ns 1014.9±0.74ns 94.1 Mtx/sec 94.0 Mtx/sec

stdb_module_large_arguments

arg size new latency old latency new throughput old throughput
64KiB 110.9±7.43µs 108.1±9.52µs - -

stdb_module_print_bulk

line count new latency old latency new throughput old throughput
1 48.8±5.82µs 56.4±5.18µs - -
100 602.5±7.18µs 594.0±3.93µs - -
1000 4.3±1.01ms 3.7±0.71ms - -

remaining

name new latency old latency new throughput old throughput
special/db_game/circles/load=10 295.8±2.54µs 296.3±1.95µs - -
special/db_game/circles/load=100 297.1±4.11µs 295.6±1.98µ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 55.6±0.07µs 53.6±0.21µs 17.6 Ktx/sec 18.2 Ktx/sec
sqlite/💿/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 47.7±0.16µs 45.9±0.16µs 20.5 Ktx/sec 21.3 Ktx/sec
sqlite/🧠/update_bulk/u32_u64_str/unique_0/load=2048/count=256 40.0±0.22µs 39.3±0.17µs 24.4 Ktx/sec 24.9 Ktx/sec
sqlite/🧠/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 37.1±0.34µs 35.2±0.04µs 26.3 Ktx/sec 27.7 Ktx/sec
stdb_module/💿/update_bulk/u32_u64_str/unique_0/load=2048/count=256 1279.5±10.97µs 1284.1±17.22µs 781 tx/sec 778 tx/sec
stdb_module/💿/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 1027.8±5.55µs 1025.3±14.01µs 972 tx/sec 975 tx/sec
stdb_raw/💿/update_bulk/u32_u64_str/unique_0/load=2048/count=256 651.5±21.90µs 648.2±18.13µs 1534 tx/sec 1542 tx/sec
stdb_raw/💿/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 435.7±8.33µs 458.4±8.04µs 2.2 Ktx/sec 2.1 Ktx/sec
stdb_raw/🧠/update_bulk/u32_u64_str/unique_0/load=2048/count=256 374.8±0.49µs 379.1±0.42µs 2.6 Ktx/sec 2.6 Ktx/sec
stdb_raw/🧠/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 337.8±0.46µs 343.1±0.27µs 2.9 Ktx/sec 2.8 Ktx/sec

@github-actions
Copy link

@github-actions github-actions bot commented on fe62e13 Oct 3, 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% 5973 5973 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 117904 117904 0.00% 118540 118532 0.01%
stdb_raw u32_u64_str no_index 64 128 1 u64 75493 75493 0.00% 75929 75949 -0.03%
stdb_raw u32_u64_str btree_each_column 64 128 2 string 24052 24051 0.00% 24500 24499 0.00%
stdb_raw u32_u64_str btree_each_column 64 128 1 u64 23019 23019 0.00% 23491 23511 -0.09%
sqlite u32_u64_str no_index 64 128 2 string 144677 144677 0.00% 146223 146223 0.00%
sqlite u32_u64_str no_index 64 128 1 u64 124027 124027 0.00% 125385 125389 -0.00%
sqlite u32_u64_str btree_each_column 64 128 2 string 134476 134476 0.00% 136222 136218 0.00%
sqlite u32_u64_str btree_each_column 64 128 1 u64 131344 131344 0.00% 132842 132834 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 895008 893733 0.14% 948378 946985 0.15%
stdb_raw u32_u64_str btree_each_column 64 128 1048713 1045200 0.34% 1112561 1077726 3.23%
sqlite u32_u64_str unique_0 64 128 398158 398158 0.00% 413110 413106 0.00%
sqlite u32_u64_str btree_each_column 64 128 983475 983475 0.00% 1021025 1021025 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 152791 152791 0.00% 152841 152841 0.00%
stdb_raw u32_u64_str unique_0 64 15816 15816 0.00% 15866 15866 0.00%
sqlite u32_u64_str unique_0 1024 1046653 1046653 0.00% 1050053 1050053 0.00%
sqlite u32_u64_str unique_0 64 74799 74799 0.00% 75913 75913 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% 50060 50060 0.00%
64 bsatn 25716 25716 0.00% 27994 27994 0.00%
16 json 12126 12126 0.00% 14030 14030 0.00%
16 bsatn 8117 8117 0.00% 9477 9477 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 20583603 20545916 0.18% 21396923 21364428 0.15%
stdb_raw u32_u64_str unique_0 64 128 1299167 1299390 -0.02% 1356351 1356618 -0.02%
sqlite u32_u64_str unique_0 1024 1024 1802091 1802091 0.00% 1811187 1811187 0.00%
sqlite u32_u64_str unique_0 64 128 128437 128437 0.00% 131265 131265 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% 6075 6075 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 117914 117914 0.00% 118542 118546 -0.00%
stdb_raw u32_u64_str no_index 64 128 1 u64 75503 75503 0.00% 75931 75907 0.03%
stdb_raw u32_u64_str btree_each_column 64 128 2 string 24062 24061 0.00% 24506 24505 0.00%
stdb_raw u32_u64_str btree_each_column 64 128 1 u64 23029 23029 0.00% 23497 23497 0.00%
sqlite u32_u64_str no_index 64 128 2 string 146598 146598 0.00% 148388 148384 0.00%
sqlite u32_u64_str no_index 64 128 1 u64 125948 125948 0.00% 127534 127538 -0.00%
sqlite u32_u64_str btree_each_column 64 128 2 string 136598 136598 0.00% 138750 138750 0.00%
sqlite u32_u64_str btree_each_column 64 128 1 u64 133440 133440 0.00% 135292 135296 -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 844373 843721 0.08% 896919 896327 0.07%
stdb_raw u32_u64_str btree_each_column 64 128 994078 994908 -0.08% 1058512 1059442 -0.09%
sqlite u32_u64_str unique_0 64 128 415701 415695 0.00% 429963 429949 0.00%
sqlite u32_u64_str btree_each_column 64 128 1021736 1021736 0.00% 1058426 1058438 -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 152801 152801 0.00% 152847 152847 0.00%
stdb_raw u32_u64_str unique_0 64 15826 15826 0.00% 15872 15872 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% 77865 77865 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% 50060 50060 0.00%
64 bsatn 25716 25716 0.00% 27994 27994 0.00%
16 json 12126 12126 0.00% 14030 14030 0.00%
16 bsatn 8117 8117 0.00% 9477 9477 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 19290660 19285743 0.03% 20186246 20185767 0.00%
stdb_raw u32_u64_str unique_0 64 128 1252019 1252021 -0.00% 1338637 1338687 -0.00%
sqlite u32_u64_str unique_0 1024 1024 1809652 1809652 0.00% 1818284 1818284 0.00%
sqlite u32_u64_str unique_0 64 128 132563 132563 0.00% 135523 135523 0.00%

Please sign in to comment.