diff --git a/config/scripts/terminal-partial-escape-tail-benchmark.mjs b/config/scripts/terminal-partial-escape-tail-benchmark.mjs index 0337daa4e9d..0ba8e974161 100644 --- a/config/scripts/terminal-partial-escape-tail-benchmark.mjs +++ b/config/scripts/terminal-partial-escape-tail-benchmark.mjs @@ -3,15 +3,16 @@ // baseline with the pre-change shape (unconditional concat + per-code-unit walk). Equivalence is // proven over a corpus first, so the reported speedup cannot come from the gate changing the answer. import { performance } from 'node:perf_hooks' -import { - advancePartialEscapeTail, - extractPartialEscapeTail, - MAX_PARTIAL_ESCAPE_TAIL_LENGTH -} from '../../src/shared/terminal-partial-escape-tail.ts' +import { createJiti } from 'jiti' const CHUNK_BYTES = 16 * 1024 const CHUNKS = 640 const ROUNDS = 7 +// jiti, not a bare `node` import: type-stripping cannot resolve the extensionless +// relative imports inside the module graph under test. +const jiti = createJiti(import.meta.url) +const { advancePartialEscapeTail, extractPartialEscapeTail, MAX_PARTIAL_ESCAPE_TAIL_LENGTH } = + await jiti.import('../../src/shared/terminal-partial-escape-tail.ts') function baselineAdvance(pendingTail, chunk) { const tail = extractPartialEscapeTail(pendingTail + chunk) diff --git a/config/scripts/worktree-refresh-churn-benchmark.mjs b/config/scripts/worktree-refresh-churn-benchmark.mjs index 5a165801ded..9e7fdffcf3c 100644 --- a/config/scripts/worktree-refresh-churn-benchmark.mjs +++ b/config/scripts/worktree-refresh-churn-benchmark.mjs @@ -1,7 +1,16 @@ #!/usr/bin/env node import { performance } from 'node:perf_hooks' -import { planWorktreeSortOrderUpdates } from '../../src/shared/worktree/sort-order-update.ts' -import { reuseEqualCatalogRows } from '../../src/renderer/src/store/slices/worktree-catalog-reconciliation.ts' +import { createJiti } from 'jiti' + +// jiti, not a bare `node` import: type-stripping cannot resolve the extensionless +// relative imports inside the module graph under test. +const jiti = createJiti(import.meta.url) +const { planWorktreeSortOrderUpdates } = await jiti.import( + '../../src/shared/worktree/sort-order-update.ts' +) +const { reuseEqualCatalogRows } = await jiti.import( + '../../src/renderer/src/store/slices/worktree-catalog-reconciliation.ts' +) const WORKTREE_COUNT = 655 const TAB_COUNT = 1_895