Reconciliation uses 32-row SQLite slices
This commit is contained in:
@@ -5,7 +5,7 @@ import { join } from 'node:path';
|
||||
import { monitorEventLoopDelay, performance } from 'node:perf_hooks';
|
||||
import { randomUUID } from 'node:crypto';
|
||||
import { setImmediate as yieldToEventLoop } from 'node:timers/promises';
|
||||
import { Market } from '../server/market/store.ts';
|
||||
import { MARKET_RECONCILIATION_BATCH_SIZE, Market } from '../server/market/store.ts';
|
||||
import { CHAIN_ID, GENESIS_HASH, transactionId } from '../server/testnet/consensus.ts';
|
||||
import { NETWORK } from '../shared/testnet.ts';
|
||||
|
||||
@@ -62,7 +62,7 @@ try {
|
||||
} finally { db.close(); }
|
||||
|
||||
const latencies: number[] = [];
|
||||
const maxPasses = Math.ceil(count / 128) * 2 + 4;
|
||||
const maxPasses = Math.ceil(count / MARKET_RECONCILIATION_BATCH_SIZE) * 2 + 4;
|
||||
const eventLoopDelay = monitorEventLoopDelay({ resolution: 10 });
|
||||
eventLoopDelay.enable();
|
||||
const start = performance.now();
|
||||
@@ -81,7 +81,7 @@ try {
|
||||
latencies.sort((a, b) => a - b);
|
||||
const percentile = (p: number) => latencies[Math.min(latencies.length - 1, Math.ceil(latencies.length * p) - 1)];
|
||||
console.log(JSON.stringify({ fixture: `synthetic-${scenario}-orders-and-listings`, orders: count, listings: count,
|
||||
batchSizePerTable: 128, reconciliationPasses: latencies.length, elapsedMs,
|
||||
batchSizePerTable: MARKET_RECONCILIATION_BATCH_SIZE, reconciliationPasses: latencies.length, elapsedMs,
|
||||
rowsPerSecond: Math.round((count * 2 * 1000) / elapsedMs), passLatencyP50Ms: percentile(0.50),
|
||||
passLatencyP95Ms: percentile(0.95), passLatencyMaxMs: latencies.at(-1), sqliteBytes: bytes,
|
||||
eventLoopDelayResolutionMs: 10, eventLoopDelayP95Ms: eventLoopDelay.percentile(95) / 1e6,
|
||||
|
||||
Reference in New Issue
Block a user