Skip to content

Commit

Permalink
c# client generate (#1707)
Browse files Browse the repository at this point in the history
  • Loading branch information
lcodes authored Oct 4, 2024
1 parent fe62e13 commit 02b70d5
Show file tree
Hide file tree
Showing 55 changed files with 3,193 additions and 1,867 deletions.
35 changes: 27 additions & 8 deletions crates/bindings-csharp/BSATN.Codegen/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,29 +184,48 @@ IEnumerable<T> values
return sb;
}

private static object? ResolveConstant(TypedConstant constant) =>
constant.Kind switch
private static object? ResolveConstant(TypedConstant constant, System.Type targetType)
{
if (constant.Kind == TypedConstantKind.Array)
{
TypedConstantKind.Array => constant.Values.Select(ResolveConstant).ToArray(),
_ => constant.Value,
};
// We can't use LINQ ToArray() here because it doesn't support dynamic Type
// and will build `object[]` instead of the desired `T[]`.
var elementType = targetType.GetElementType();
var array = Array.CreateInstance(elementType, constant.Values.Length);
for (var i = 0; i < constant.Values.Length; i++)
{
array.SetValue(ResolveConstant(constant.Values[i], elementType), i);
}
return array;
}
return constant.Value;
}

public static T ParseAs<T>(this AttributeData attrData, System.Type? type = null)
where T : Attribute
{
type ??= typeof(T);
var ctorArgs = attrData.ConstructorArguments.Select(ResolveConstant).ToArray();

// For now only support attributes with a single constructor.
//
// Proper overload resolution is complicated due to implicit casts
// (in particular, enums are represented as integers in the attribute data),
// which prevent APIs like `Activator.CreateInstance` from finding the constructor.
//
// Expand logic in the future if it ever becomes actually necessary.
var attr = (T)type.GetConstructors().Single().Invoke(ctorArgs);
var ctor = type.GetConstructors().Single();

var ctorArgs = attrData
.ConstructorArguments.Zip(
ctor.GetParameters().Select(param => param.ParameterType),
ResolveConstant
)
.ToArray();
var attr = (T)ctor.Invoke(ctorArgs);
foreach (var arg in attrData.NamedArguments)
{
type.GetProperty(arg.Key).SetValue(attr, ResolveConstant(arg.Value));
var prop = type.GetProperty(arg.Key);
prop.SetValue(attr, ResolveConstant(arg.Value, prop.PropertyType));
}
return attr;
}
Expand Down
80 changes: 80 additions & 0 deletions crates/bindings-csharp/BSATN.Runtime/Builtins.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
namespace SpacetimeDB;

using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using SpacetimeDB.BSATN;
using SpacetimeDB.Internal;

Expand Down Expand Up @@ -125,3 +127,81 @@ public AlgebraicType GetAlgebraicType(ITypeRegistrar registrar) =>
// This must be explicitly forwarded to base, otherwise record will generate a new implementation.
public override string ToString() => base.ToString();
}

// We store time information in microseconds in internal usages.
//
// These utils allow to encode it as such in FFI and BSATN contexts
// and convert to standard C# types.

[StructLayout(LayoutKind.Sequential)] // we should be able to use it in FFI
[SpacetimeDB.Type] // we should be able to encode it to BSATN too
public partial struct DateTimeOffsetRepr(DateTimeOffset time)
{
public ulong MicrosecondsSinceEpoch = (ulong)time.Ticks / 10;

public readonly DateTimeOffset ToStd() =>
DateTimeOffset.UnixEpoch.AddTicks(10 * (long)MicrosecondsSinceEpoch);
}

[StructLayout(LayoutKind.Sequential)] // we should be able to use it in FFI
[SpacetimeDB.Type] // we should be able to encode it to BSATN too
public partial struct TimeSpanRepr(TimeSpan duration)
{
public ulong Microseconds = (ulong)duration.Ticks / 10;

public readonly TimeSpan ToStd() => TimeSpan.FromTicks(10 * (long)Microseconds);
}

// [SpacetimeDB.Type] - we have custom representation of time in microseconds, so implementing BSATN manually
public abstract partial record ScheduleAt
: SpacetimeDB.TaggedEnum<(DateTimeOffset Time, TimeSpan Interval)>
{
// Manual expansion of what would be otherwise generated by the [SpacetimeDB.Type] codegen.
public sealed record Time(DateTimeOffset Time_) : ScheduleAt;

public sealed record Interval(TimeSpan Interval_) : ScheduleAt;

public static implicit operator ScheduleAt(DateTimeOffset time) => new Time(time);

public static implicit operator ScheduleAt(TimeSpan interval) => new Interval(interval);

public readonly partial struct BSATN : IReadWrite<ScheduleAt>
{
[SpacetimeDB.Type]
private partial record ScheduleAtRepr
: SpacetimeDB.TaggedEnum<(DateTimeOffsetRepr Time, TimeSpanRepr Interval)>;

private static readonly ScheduleAtRepr.BSATN ReprBSATN = new();

public ScheduleAt Read(BinaryReader reader) =>
ReprBSATN.Read(reader) switch
{
ScheduleAtRepr.Time(var timeRepr) => new Time(timeRepr.ToStd()),
ScheduleAtRepr.Interval(var intervalRepr) => new Interval(intervalRepr.ToStd()),
_ => throw new SwitchExpressionException(),
};

public void Write(BinaryWriter writer, ScheduleAt value)
{
ReprBSATN.Write(
writer,
value switch
{
Time(var time) => new ScheduleAtRepr.Time(new(time)),
Interval(var interval) => new ScheduleAtRepr.Interval(new(interval)),
_ => throw new SwitchExpressionException(),
}
);
}

public AlgebraicType GetAlgebraicType(ITypeRegistrar registrar) =>
// Constructing a custom one instead of ScheduleAtRepr.GetAlgebraicType()
// to avoid leaking the internal *Repr wrappers in generated SATS.
new AlgebraicType.Sum(
[
new("Time", new AlgebraicType.U64(default)),
new("Interval", new AlgebraicType.U64(default)),
]
);
}
}
8 changes: 8 additions & 0 deletions crates/bindings-csharp/Codegen.Tests/fixtures/diag/Lib.cs
Original file line number Diff line number Diff line change
Expand Up @@ -374,3 +374,11 @@ public static void TestIncompatibleScheduleReducer(
TestIncompatibleSchedule table
) { }
}

[SpacetimeDB.Table]
[SpacetimeDB.Index]
public partial struct TestIndexWithoutColumns { }

[SpacetimeDB.Table]
[SpacetimeDB.Index(BTree = [])]
public partial struct TestIndexWithEmptyColumns { }
Loading

2 comments on commit 02b70d5

@github-actions
Copy link

@github-actions github-actions bot commented on 02b70d5 Oct 4, 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 💿 404.3±1.22ns 408.7±2.51ns - -
sqlite 🧠 406.3±3.61ns 408.8±1.20ns - -
stdb_raw 💿 638.1±1.38ns 627.3±4.22ns - -
stdb_raw 🧠 638.5±1.51ns 625.6±1.86ns - -

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 587.9±0.59µs 593.8±1.13µs 1701 tx/sec 1684 tx/sec
sqlite 💿 u32_u64_str unique_0 2048 256 153.7±0.33µs 151.9±0.59µs 6.4 Ktx/sec 6.4 Ktx/sec
sqlite 💿 u32_u64_u64 btree_each_column 2048 256 467.3±0.89µs 469.6±0.45µs 2.1 Ktx/sec 2.1 Ktx/sec
sqlite 💿 u32_u64_u64 unique_0 2048 256 138.3±0.37µs 137.4±0.66µs 7.1 Ktx/sec 7.1 Ktx/sec
sqlite 🧠 u32_u64_str btree_each_column 2048 256 450.8±0.39µs 453.4±0.28µs 2.2 Ktx/sec 2.2 Ktx/sec
sqlite 🧠 u32_u64_str unique_0 2048 256 124.8±0.43µs 121.7±0.45µs 7.8 Ktx/sec 8.0 Ktx/sec
sqlite 🧠 u32_u64_u64 btree_each_column 2048 256 369.0±0.82µs 368.9±1.33µs 2.6 Ktx/sec 2.6 Ktx/sec
sqlite 🧠 u32_u64_u64 unique_0 2048 256 105.7±0.44µs 106.8±0.97µs 9.2 Ktx/sec 9.1 Ktx/sec
stdb_raw 💿 u32_u64_str btree_each_column 2048 256 581.2±19.41µs 582.0±44.04µs 1720 tx/sec 1718 tx/sec
stdb_raw 💿 u32_u64_str unique_0 2048 256 473.2±41.06µs 490.7±28.45µs 2.1 Ktx/sec 2038 tx/sec
stdb_raw 💿 u32_u64_u64 btree_each_column 2048 256 384.6±6.71µs 385.7±5.06µs 2.5 Ktx/sec 2.5 Ktx/sec
stdb_raw 💿 u32_u64_u64 unique_0 2048 256 357.8±8.14µs 355.5±13.63µs 2.7 Ktx/sec 2.7 Ktx/sec
stdb_raw 🧠 u32_u64_str btree_each_column 2048 256 307.6±0.36µs 307.9±0.36µs 3.2 Ktx/sec 3.2 Ktx/sec
stdb_raw 🧠 u32_u64_str unique_0 2048 256 241.8±0.24µs 237.4±0.19µs 4.0 Ktx/sec 4.1 Ktx/sec
stdb_raw 🧠 u32_u64_u64 btree_each_column 2048 256 251.4±0.14µs 246.2±0.13µs 3.9 Ktx/sec 4.0 Ktx/sec
stdb_raw 🧠 u32_u64_u64 unique_0 2048 256 220.6±0.24µs 218.8±0.12µs 4.4 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.6±0.32µs 23.5±0.11µs 43.1 Ktx/sec 41.6 Ktx/sec
sqlite 💿 u32_u64_u64 unique_0 20.7±0.32µs 21.8±0.05µs 47.2 Ktx/sec 44.9 Ktx/sec
sqlite 🧠 u32_u64_str unique_0 19.9±0.15µs 21.0±0.12µs 49.0 Ktx/sec 46.5 Ktx/sec
sqlite 🧠 u32_u64_u64 unique_0 18.0±0.23µs 19.3±0.04µs 54.4 Ktx/sec 50.7 Ktx/sec
stdb_raw 💿 u32_u64_str unique_0 4.8±0.00µs 4.7±0.00µs 202.7 Ktx/sec 206.3 Ktx/sec
stdb_raw 💿 u32_u64_u64 unique_0 4.7±0.00µs 4.6±0.00µs 206.7 Ktx/sec 210.5 Ktx/sec
stdb_raw 🧠 u32_u64_str unique_0 4.8±0.00µs 4.8±0.00µs 202.1 Ktx/sec 205.6 Ktx/sec
stdb_raw 🧠 u32_u64_u64 unique_0 4.7±0.00µs 4.6±0.01µs 206.7 Ktx/sec 210.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 69.6±0.23µs 68.5±0.27µs 14.0 Ktx/sec 14.3 Ktx/sec
sqlite 💿 u64 index 2048 256 65.8±0.10µs 66.4±0.20µs 14.8 Ktx/sec 14.7 Ktx/sec
sqlite 🧠 string index 2048 256 65.9±0.11µs 64.7±0.25µs 14.8 Ktx/sec 15.1 Ktx/sec
sqlite 🧠 u64 index 2048 256 59.9±0.17µs 60.5±0.35µs 16.3 Ktx/sec 16.1 Ktx/sec
stdb_raw 💿 string index 2048 256 4.9±0.00µs 4.9±0.00µs 200.5 Ktx/sec 198.9 Ktx/sec
stdb_raw 💿 u64 index 2048 256 4.8±0.00µs 4.7±0.00µs 201.7 Ktx/sec 207.7 Ktx/sec
stdb_raw 🧠 string index 2048 256 4.9±0.00µs 4.9±0.00µs 200.3 Ktx/sec 198.9 Ktx/sec
stdb_raw 🧠 u64 index 2048 256 4.8±0.00µs 4.7±0.00µs 201.8 Ktx/sec 207.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.3±0.00µs 3.2±0.02µs 29.3 Mtx/sec 29.4 Mtx/sec
u32_u64_str bflatn_to_bsatn_slow_path 100 3.0±0.01µs 3.0±0.01µs 31.3 Mtx/sec 31.8 Mtx/sec
u32_u64_str bsatn 100 2.4±0.00µs 2.3±0.00µs 40.5 Mtx/sec 41.1 Mtx/sec
u32_u64_str bsatn 100 40.5±0.67ns 40.5±0.03ns 2.3 Gtx/sec 2.3 Gtx/sec
u32_u64_str json 100 5.7±0.02µs 4.7±0.06µs 16.8 Mtx/sec 20.4 Mtx/sec
u32_u64_str json 100 7.1±0.02µs 8.4±0.02µs 13.5 Mtx/sec 11.4 Mtx/sec
u32_u64_str product_value 100 1017.5±0.47ns 1018.3±0.52ns 93.7 Mtx/sec 93.6 Mtx/sec
u32_u64_u64 bflatn_to_bsatn_fast_path 100 1160.5±1.25ns 1188.7±3.43ns 82.2 Mtx/sec 80.2 Mtx/sec
u32_u64_u64 bflatn_to_bsatn_slow_path 100 2.5±0.00µs 2.5±0.01µs 38.9 Mtx/sec 37.9 Mtx/sec
u32_u64_u64 bsatn 100 1668.2±31.71ns 1644.1±1.72ns 57.2 Mtx/sec 58.0 Mtx/sec
u32_u64_u64 bsatn 100 39.4±0.09ns 39.3±0.08ns 2.4 Gtx/sec 2.4 Gtx/sec
u32_u64_u64 json 100 3.4±0.06µs 3.1±0.05µs 28.3 Mtx/sec 30.7 Mtx/sec
u32_u64_u64 json 100 4.9±0.16µs 5.1±0.05µs 19.3 Mtx/sec 18.6 Mtx/sec
u32_u64_u64 product_value 100 1014.6±1.53ns 1013.2±1.59ns 94.0 Mtx/sec 94.1 Mtx/sec
u64_u64_u32 bflatn_to_bsatn_fast_path 100 922.4±1.27ns 892.4±2.01ns 103.4 Mtx/sec 106.9 Mtx/sec
u64_u64_u32 bflatn_to_bsatn_slow_path 100 2.5±0.00µs 2.5±0.00µs 38.8 Mtx/sec 38.3 Mtx/sec
u64_u64_u32 bsatn 100 1697.6±36.77ns 1655.7±32.22ns 56.2 Mtx/sec 57.6 Mtx/sec
u64_u64_u32 bsatn 100 707.3±0.42ns 749.6±0.38ns 134.8 Mtx/sec 127.2 Mtx/sec
u64_u64_u32 json 100 3.6±0.04µs 3.1±0.04µs 26.2 Mtx/sec 31.3 Mtx/sec
u64_u64_u32 json 100 5.0±0.01µs 4.8±0.00µs 19.3 Mtx/sec 19.8 Mtx/sec
u64_u64_u32 product_value 100 1015.7±1.15ns 1014.0±0.42ns 93.9 Mtx/sec 94.1 Mtx/sec

stdb_module_large_arguments

arg size new latency old latency new throughput old throughput
64KiB 104.0±7.68µs 110.9±7.43µs - -

stdb_module_print_bulk

line count new latency old latency new throughput old throughput
1 51.0±7.13µs 48.8±5.82µs - -
100 592.0±6.56µs 602.5±7.18µs - -
1000 3.7±0.70ms 4.3±1.01ms - -

remaining

name new latency old latency new throughput old throughput
special/db_game/circles/load=10 295.0±5.49µs 295.8±2.54µs - -
special/db_game/circles/load=100 294.1±4.65µs 297.1±4.11µ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 53.2±0.23µs 55.6±0.07µs 18.3 Ktx/sec 17.6 Ktx/sec
sqlite/💿/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 45.6±0.11µs 47.7±0.16µs 21.4 Ktx/sec 20.5 Ktx/sec
sqlite/🧠/update_bulk/u32_u64_str/unique_0/load=2048/count=256 37.8±0.17µs 40.0±0.22µs 25.9 Ktx/sec 24.4 Ktx/sec
sqlite/🧠/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 34.4±0.24µs 37.1±0.34µs 28.4 Ktx/sec 26.3 Ktx/sec
stdb_module/💿/update_bulk/u32_u64_str/unique_0/load=2048/count=256 1288.0±12.68µs 1279.5±10.97µs 776 tx/sec 781 tx/sec
stdb_module/💿/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 1029.5±31.75µs 1027.8±5.55µs 971 tx/sec 972 tx/sec
stdb_raw/💿/update_bulk/u32_u64_str/unique_0/load=2048/count=256 550.7±17.58µs 651.5±21.90µs 1815 tx/sec 1534 tx/sec
stdb_raw/💿/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 494.4±7.63µs 435.7±8.33µs 2022 tx/sec 2.2 Ktx/sec
stdb_raw/🧠/update_bulk/u32_u64_str/unique_0/load=2048/count=256 375.3±0.41µs 374.8±0.49µs 2.6 Ktx/sec 2.6 Ktx/sec
stdb_raw/🧠/update_bulk/u32_u64_u64/unique_0/load=2048/count=256 346.8±0.50µs 337.8±0.46µs 2.8 Ktx/sec 2.9 Ktx/sec

@github-actions
Copy link

@github-actions github-actions bot commented on 02b70d5 Oct 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 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% 118568 118540 0.02%
stdb_raw u32_u64_str no_index 64 128 1 u64 75493 75493 0.00% 75929 75929 0.00%
stdb_raw u32_u64_str btree_each_column 64 128 2 string 24051 24052 -0.00% 24499 24500 -0.00%
stdb_raw u32_u64_str btree_each_column 64 128 1 u64 23019 23019 0.00% 23523 23491 0.14%
sqlite u32_u64_str no_index 64 128 2 string 144677 144677 0.00% 146219 146223 -0.00%
sqlite u32_u64_str no_index 64 128 1 u64 124027 124027 0.00% 125389 125385 0.00%
sqlite u32_u64_str btree_each_column 64 128 2 string 134476 134476 0.00% 136218 136222 -0.00%
sqlite u32_u64_str btree_each_column 64 128 1 u64 131344 131344 0.00% 132842 132842 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 895743 895008 0.08% 949089 948378 0.07%
stdb_raw u32_u64_str btree_each_column 64 128 1047833 1048713 -0.08% 1080267 1112561 -2.90%
sqlite u32_u64_str unique_0 64 128 398158 398158 0.00% 413106 413110 -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 20585379 20583603 0.01% 21399253 21396923 0.01%
stdb_raw u32_u64_str unique_0 64 128 1299251 1299167 0.01% 1356105 1356351 -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% 118526 118542 -0.01%
stdb_raw u32_u64_str no_index 64 128 1 u64 75503 75503 0.00% 75907 75931 -0.03%
stdb_raw u32_u64_str btree_each_column 64 128 2 string 24065 24062 0.01% 24509 24506 0.01%
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% 148384 148388 -0.00%
sqlite u32_u64_str no_index 64 128 1 u64 125948 125948 0.00% 127534 127534 0.00%
sqlite u32_u64_str btree_each_column 64 128 2 string 136598 136598 0.00% 138754 138750 0.00%
sqlite u32_u64_str btree_each_column 64 128 1 u64 133446 133440 0.00% 135302 135292 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 844190 844373 -0.02% 896740 896919 -0.02%
stdb_raw u32_u64_str btree_each_column 64 128 995612 994078 0.15% 1060232 1058512 0.16%
sqlite u32_u64_str unique_0 64 128 415695 415701 -0.00% 429957 429963 -0.00%
sqlite u32_u64_str btree_each_column 64 128 1021736 1021736 0.00% 1058438 1058426 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% 152875 152847 0.02%
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 19285155 19290660 -0.03% 20180705 20186246 -0.03%
stdb_raw u32_u64_str unique_0 64 128 1251472 1252019 -0.04% 1338144 1338637 -0.04%
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.