Skip to content

Add Proxy trap dispatch benchmarks#2666

Merged
lahma merged 1 commit into
sebastienros:mainfrom
lahma:proxy-benchmark
Jul 13, 2026
Merged

Add Proxy trap dispatch benchmarks#2666
lahma merged 1 commit into
sebastienros:mainfrom
lahma:proxy-benchmark

Conversation

@lahma

@lahma lahma commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Adds ProxyBenchmark covering the proxy internal-method surface ahead of a series of Proxy correctness/performance PRs:

  • Trap dispatch: TrapGet / TrapSet / TrapHas — hot loops through a handler with get/set/has traps
  • Trap-less forwarding: ForwardGet / ForwardSet — empty handler, measures the forwarding overhead a proxy adds over direct access
  • ownKeys: OwnKeysTrap / OwnKeysForwardObject.keys over a 10-property target
  • Callable proxies: ApplyTrap / ApplyForward / ConstructTrap
  • Revocation: RevocableCreate (create + revoke cycle), RevokedTypeof (typeof on a revoked function proxy)

No product code changes. Follows house benchmark conventions (MemoryDiagnoser, default job, prepared scripts, single engine).

Note: ConstructTrap deliberately constructs with two arguments — the single-numeric-argument construct path currently mangles the trap's arguments list (fix in a follow-up PR), and two arguments keep this lane's numbers comparable before and after that fix.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EsHuKuE4UihKZp5HYapDHE

@lahma
lahma enabled auto-merge (squash) July 13, 2026 12:51
@lahma
lahma force-pushed the proxy-benchmark branch from 2594df7 to 2e7bce0 Compare July 13, 2026 12:52
New ProxyBenchmark lane measuring per-operation Proxy trap machinery:
get/set/has through an explicit handler vs an empty forwarding handler,
ownKeys via Object.keys, apply/construct on a function proxy, revocable
create+revoke churn, and typeof on a revoked function proxy (must not
throw). Prepared scripts on a single engine, standard MemoryDiagnoser
lane layout. No product code changes.

ConstructTrap passes two constructor arguments on purpose: a single
numeric argument currently trips Array(n) length semantics when
JsProxy.Construct builds the trap argumentsList via the Array
constructor instead of CreateArrayFromList.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EsHuKuE4UihKZp5HYapDHE
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