fix: Stabilize benchmark sampling and expand storage reporting (#37)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Marcelo Mendonça Soares <marcelo.me.soares@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Copilot 2026-05-07 00:17:30 -03:00 • committed by GitHub
commit 0307094d58
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -34,7 +34,7 @@ Future<void> main(List<String> args) async {
crdtEnabled: false,
operation: operation,
rowCount: rowCount,
).report(),
).measure(),
skipProgress: runningInCI,
);
@ -45,8 +45,8 @@ Future<void> main(List<String> args) async {
crdtEnabled: true,
operation: operation,
rowCount: rowCount,
).report(),
validator: (result) => result.$1 > baselineResult.$1,
).measure(),
validator: (result) => result > baselineResult,
skipProgress: runningInCI,
);
@ -60,7 +60,7 @@ Future<void> main(List<String> args) async {
}
final spuriousBenchmarks = benchmarkResults.where(
(result) => result.baseline.$1 > result.crdt.$1,
(result) => result.baseline > result.crdt,
);
if (spuriousBenchmarks.isNotEmpty) {
@ -74,8 +74,8 @@ Future<void> main(List<String> args) async {
);
for (final result in spuriousBenchmarks) {
final baselineDelay = result.baseline.$1.toFormattedDuration();
final crdtDelay = result.crdt.$1.toFormattedDuration();
final baselineDelay = result.baseline.toFormattedDuration();
final crdtDelay = result.crdt.toFormattedDuration();
print(
' - ${result.operation.name.toUpperCase()}: $baselineDelay > $crdtDelay',
);
@ -89,8 +89,29 @@ Future<void> main(List<String> args) async {
runningInCI: runningInCI,
);
}
final baselineStorageResult = await runWithProgress(
'Running storage benchmark (baseline)',
() => TypesTableStorageBenchmark(
'storage (baseline)',
crdtEnabled: false,
rowCount: rowCount,
).reportStorage(),
skipProgress: runningInCI,
);
final crdtStorageResult = await runWithProgress(
'Running storage benchmark (CRDT)',
() => TypesTableStorageBenchmark(
'storage (CRDT)',
crdtEnabled: true,
rowCount: rowCount,
).reportStorage(),
skipProgress: runningInCI,
);
printStorageImpact(
benchmarkResults.first,
StorageBenchmarkResults(
baseline: baselineStorageResult,
crdt: crdtStorageResult,
),
rowCount: rowCount,
runningInCI: runningInCI,
);