[
https://issues.apache.org/jira/browse/GROOVY-12137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18094268#comment-18094268
]
ASF GitHub Bot commented on GROOVY-12137:
-----------------------------------------
paulk-asert opened a new pull request, #2673:
URL: https://github.com/apache/groovy/pull/2673
…ike)
Behind the groovy.indy.cold.reflection flag (default: off), plain method
calls dispatch reflectively while a call site is cold, deferring all
MethodHandle chain construction — and its one-time LambdaForm creation cost —
to hit-count promotion. The shared cold dispatcher has a single
(Object[])Object shape for every call site, arity, and primitive pattern;
promotion installs the unchanged full guarded chain, so the hot path is
identical to master.
Plain calls are public, non-static, non-category CachedMethods on public
classes with a real receiver and no spread/safe-null/interceptor semantics;
caller-sensitive targets (including unannotated caller-context-sensitive cases
like object serialization, and interface selections resolving to sensitive
implementations) stay on the full path. Selection reuses Selector's existing
logic via a new selection-only hook; validity is re-checked per call with
plain-Java equivalents of the chain's guards. A per-wrapper cumulative counter
promotes polymorphic receiver shapes that the consecutive-hit counter never
catches.
Measured (deterministic class-load counters + fresh-JVM timing): ~2/3 of
per-shape LambdaForm cost removed on cold dispatch workloads, 1.34-1.40x faster
cold dispatch with many cold sites, steady state unchanged after promotion,
MOP-heavy test subset (3437 tests) green with the flag on.
> experimental reflective cold tier for indy dispatch
> ---------------------------------------------------
>
> Key: GROOVY-12137
> URL: https://issues.apache.org/jira/browse/GROOVY-12137
> Project: Groovy
> Issue Type: Task
> Reporter: Paul King
> Priority: Major
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)