mirror of
https://github.com/hellodigua/ChatLab.git
synced 2026-10-26 02:04:37 +08:00
fix(import): make performance baselines trustworthy
Run benchmarks in isolated GC-enabled workers, report sparse RSS samples accurately, and hash canonical imported output. Require the Rust Native WeFlow kernel and reject any measured import that falls back to TypeScript so timing and memory baselines remain comparable.
This commit is contained in:
1 parent
bbbd0bb3c6
commit
bd7c838c3f
7 files changed
+277
-40
No files matched your search
@@ -78,8 +78,8 @@ function createDeps(options?: {
|
||||
messageBatchCount: 0,
|
||||
messageTransactionCount: 0,
|
||||
rssStartMb: 0,
|
||||
rssPeakMb: 0,
|
||||
rssDeltaMb: 0,
|
||||
rssSampledPeakMb: 0,
|
||||
rssSampledDeltaMb: 0,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -89,8 +89,8 @@ function assertPerformanceDiagnostics(result: StreamImportResult): void {
|
||||
assert.ok(diagnostics.timings.totalMs >= diagnostics.timings.messageWriteMs)
|
||||
assert.ok(diagnostics.messageBatchCount > 0)
|
||||
assert.ok(diagnostics.messageTransactionCount > 0)
|
||||
assert.ok(diagnostics.rssPeakMb >= diagnostics.rssStartMb)
|
||||
assert.ok(diagnostics.rssDeltaMb >= 0)
|
||||
assert.ok(diagnostics.rssSampledPeakMb >= diagnostics.rssStartMb)
|
||||
assert.ok(diagnostics.rssSampledDeltaMb >= 0)
|
||||
}
|
||||
|
||||
function writeChunkedShuakamiQqExport(root: string): string {
|
||||
|
||||
@@ -71,8 +71,9 @@ export interface ImportPerformanceDiagnostics {
|
||||
messageBatchCount: number
|
||||
messageTransactionCount: number
|
||||
rssStartMb: number
|
||||
rssPeakMb: number
|
||||
rssDeltaMb: number
|
||||
/** Highest RSS observed at import stage and parser batch boundaries; not a continuous process peak. */
|
||||
rssSampledPeakMb: number
|
||||
rssSampledDeltaMb: number
|
||||
}
|
||||
|
||||
export interface StreamImportResult {
|
||||
@@ -843,8 +844,8 @@ async function streamImportSingle(
|
||||
messageBatchCount: callbackStats.onMessageBatchCalls,
|
||||
messageTransactionCount,
|
||||
rssStartMb: rssStartBytes / bytesPerMegabyte,
|
||||
rssPeakMb: rssPeakBytes / bytesPerMegabyte,
|
||||
rssDeltaMb: (rssPeakBytes - rssStartBytes) / bytesPerMegabyte,
|
||||
rssSampledPeakMb: rssPeakBytes / bytesPerMegabyte,
|
||||
rssSampledDeltaMb: (rssPeakBytes - rssStartBytes) / bytesPerMegabyte,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user