Add CLR ProxyHandler lanes to ProxyBenchmark#2680
Merged
Merged
Conversation
lahma
enabled auto-merge (squash)
July 13, 2026 22:11
Collaborator
Author
|
Measured comparison (same run, serial, DefaultJob — medians):
The CLR path skips the per-operation trap-name property lookup, the trap argument array, and (for apply) the 🤖 Generated with Claude Code |
Extend ProxyBenchmark with six lanes exercising the new public CLR trap API (Jint.Runtime.Interop.ProxyHandler + engine.Advanced.CreateProxy): ClrTrapGet, ClrTrapSet, ClrTrapHas, ClrForwardGet, ClrApplyTrap and ClrConstructTrap. Each is a 1:1 mirror of the corresponding JS-handler lane (same targets, same prepared-script shape and iteration counts) so the columns compare JS-handler versus CLR-handler trap dispatch directly. The handlers mirror the JS setup semantically: TrappingClrHandler implements get/set/has via target.Get/Set/HasProperty, ForwardingClrHandler overrides nothing (pure forward), and ApplyClrHandler invokes the target through Engine.Call and constructs a plain JsObject with property v. GlobalSetup warm-evaluates the new lanes and asserts their numeric results, throwing on any trap-wiring mismatch. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EsHuKuE4UihKZp5HYapDHE
lahma
force-pushed
the
proxy-clr-handler-benchmarks
branch
from
July 13, 2026 22:18
495ee17 to
505278f
Compare
This was referenced Jul 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #2678: adds six lanes exercising the new CLR
ProxyHandlerpath, 1:1 mirrors of the existing JS-handler lanes (same target objects, same script shapes and iteration counts) so the columns compare directly:ClrTrapGet/ClrTrapSet/ClrTrapHas— C# handler implementing the same semantics as the JS{ get, set, has }handlerClrForwardGet— handler with no overrides (pure forward through the CLR branch)ClrApplyTrap/ClrConstructTrap— C# apply/construct traps over the same function targetThis puts numbers behind #2678's "the CLR path skips trap-name lookup and argument arrays" claim and guards the new dispatch branch against regressions. Each lane is warm-evaluated once in GlobalSetup with its numeric result asserted, so a wrong-semantics lane fails loudly instead of benchmarking garbage.
No product code changes. Measured comparison table to follow as a comment (runs are done serially, nothing else on the machine).
🤖 Generated with Claude Code
https://claude.ai/code/session_01EsHuKuE4UihKZp5HYapDHE