paulk-asert opened a new pull request, #2712:
URL: https://github.com/apache/groovy/pull/2712

   The cached fast path covered only zero- and one-argument call overrides 
(GROOVY-11911, GROOVY-12164), so every multi-argument closure call from Java -- 
all Map iteration, eachWithIndex, inject -- took full metaclass dispatch. 
Generalise the cache to an arity-indexed table (0..4) with per-argument 
instance-of guards: at each arity an all-Object override wins outright (the 
11911 rule), otherwise the single unambiguous typed override dispatches when 
every argument is already an instance of its declared type (the 12164 rule), 
and anything else (coercion, null, same-arity overloads, static declarations, 
array params) falls through to the metaclass exactly as before. Map#each is 
~3-3.6x faster, inject ~2x, eachWithIndex ~1.65x; one-arg calls also gain ~13% 
by spreading the argument array directly instead of re-wrapping it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to