Skip to content

perf(win32): prepared call descriptors and register-based dispatch - #52

Merged
triniwiz merged 1 commit into
mainfrom
perf/win32-call
Nov 11, 2026
Merged

triniwiz merged 1 commit into
mainfrom
perf/win32-call

Conversation

@triniwiz

@triniwiz triniwiz commented Nov 11, 2026 •

Copy link
Copy Markdown
Member
  • win32_call.rs: a signature is parsed once into a cached descriptor (address, argument kinds, libffi cif). Up to 8 arguments go straight through the argument registers on x64 and arm64; longer signatures use libffi.
  • Classic: define() returns V8 fast API functions; bind() locks a function's argument types in on its first call. Fast calls convert numbers, bools, null, BigInts, ArrayBuffers and strings without a handle scope.
  • napi: new __nsWin32Bind; define() and bind() use it the same way.
  • NSWIN_V8_FLAGS passes extra V8 flags (e.g. --trace-deopt) on the classic engine.
  • packages/demo/win32-bench.js measures call overhead on every engine.

Tests: new win32_define_bound_functions, win32_bind_locks_argument_types and win32_pointer_argument_rejects_plain_objects integration tests; windows-napi/test/win32-test.js covers floats, stack arguments, lock-in and errors.

Ports the linux-runtime Win32 call path. win32_call.rs parses a signature
once into a prepared descriptor and calls through the argument registers
(up to 8 args on the fast API). define() binds every function up front;
bind() locks a function's types in from its first call. Applies to the
classic engine and napi. Adds NSWIN_V8_FLAGS and packages/demo/win32-bench.js.
@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Pre-merge checks: Passed 1 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Title check Pending This assessment has not completed. The check will be retried on the next pre-merge check run.
Passed Passed checks: 1 passed

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@triniwiz
triniwiz merged commit 95a9664 into main Nov 11, 2026
3 checks passed
@triniwiz
triniwiz deleted the perf/win32-call branch November 11, 2026 13:57
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