Skip to content

benchmarks: resolve paths with import.meta.dirname so the suite runs on Windows - #75

Open
adstep wants to merge 1 commit into
yjs:masterfrom
adstep:adstep-benchmark-windows-path-fix-ee5
Open

adstep wants to merge 1 commit into
yjs:masterfrom
adstep:adstep-benchmark-windows-path-fix-ee5

Conversation

@adstep

@adstep adstep commented Oct 14, 2026

Copy link
Copy Markdown

The benchmark suite builds file paths with new URL(..., import.meta.url).pathname. On Windows that returns /D:/..., which Node resolves to D:\D:\..., so the suite fails with ENOENT when it writes RESULTS.md and when it forks proc/hub.js or proc/y-native.js.

This switches the four call sites to path.join(import.meta.dirname, ...), which gives native paths on every platform. The repo already requires Node 22+, so import.meta.dirname is always available.

  • src/index.js: RESULTS.md output path
  • src/cluster.js: forked hub process
  • src/suites/y1-primitives.js: forked y-native process
  • src/trace.js: trace file path

Testing (Windows 11, Node 26): ran y1.2, y1.7 with useYNative: true, y2.1 against the dev databases, and y7.1 with a placeholder trace file (confirms it is found and read). All four paths now resolve correctly. npx standard benchmarks/src/ passes.

…on Windows

Copilot-Session: 57346a82-6880-4206-9552-9105be00e3e7
@adstep
adstep marked this pull request as ready for review October 14, 2026 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant