mirror of
https://github.com/openclaw/openclaw.git
synced 2026-10-03 09:39:25 +00:00
* perf(workspace): offload inventory and manifest processing Keep the Gateway and paired nodes responsive during large workspace transfers with bounded computation workers. Hosts retain session authority, Git processes, file writes, durable acceptance, and cleanup. Use transferable UTF-8 payloads for supported Unicode inventories, preserve independent errors during cancellation, and compare already-decoded manifests without copying their object graphs between threads. * test(workspace): finish manifest fixture ownership * refactor(workspace): distinguish stage input implementation * test: register workspace benchmark and honor system Bash
18 lines
565 B
TypeScript
18 lines
565 B
TypeScript
import { performance } from "node:perf_hooks";
|
|
|
|
/** Timer drift also captures work that blocks before the native histogram's first poll. */
|
|
export function startBenchmarkIntervalDelay(): () => number[] {
|
|
const intervalMs = 10;
|
|
const samples: number[] = [];
|
|
let previousTick = performance.now();
|
|
const timer = setInterval(() => {
|
|
const now = performance.now();
|
|
samples.push(Math.max(0, now - previousTick - intervalMs));
|
|
previousTick = now;
|
|
}, intervalMs);
|
|
timer.unref();
|
|
return () => {
|
|
clearInterval(timer);
|
|
return samples;
|
|
};
|
|
}
|