This is an automated email from the ASF dual-hosted git repository.
paulk-asert pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/groovy-website.git
The following commit(s) were added to refs/heads/asf-site by this push:
new 2f21ebf updated with recent changes
2f21ebf is described below
commit 2f21ebfbf1d500547f01fd4efe735912abfd78c7
Author: Paul King <[email protected]>
AuthorDate: Mon Jul 13 09:34:10 2026 +1000
updated with recent changes
---
site/src/site/wiki/GEP-27.adoc | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/site/src/site/wiki/GEP-27.adoc b/site/src/site/wiki/GEP-27.adoc
index a6381d9..ac4c066 100644
--- a/site/src/site/wiki/GEP-27.adoc
+++ b/site/src/site/wiki/GEP-27.adoc
@@ -466,7 +466,8 @@ by name with runtime overload selection and *silently
ignores* a caller-set dele
`PackedClosure` binds a fixed `MethodHandle` and *rejects* one. The two are
worth _contract_-aligning
(a shared "known-target, delegate-inert" marker and consistent delegate
handling), and both could
share the per-arity handle-selection primitive that default-parameter packing
(see _Excluded and
-deferred features_) also needs. Their dispatch models differ enough, though —
a fixed handle versus
+deferred features_) needs — the same mechanism that would close the remaining
dynamic-dispatch
+throughput gap (see _Performance_). Their dispatch models differ enough,
though — a fixed handle versus
runtime overload selection — that fully merging them into one path is not a
goal; this is tracked as a
separate initiative.
@@ -740,6 +741,18 @@ the compatibility valve while tools are updated.
`MethodHandle` constant (`invokeExact`) behind a lean `doCall` fast path.
Measured per `call()`, a
naive shared adapter is ~7–9× slower; the shipped one is at parity under
`@CompileStatic` and ~2×
under dynamic compilation (so the dynamic path stays opt-in).
+* Capturing closures (the common case, e.g. `{ it + base }`) used to pay an
extra per-call cost — the
+ adapter allocated an argument array prepending the captures on every
invocation. Binding the captures
+ into the handle once at construction removes that allocation (GROOVY-12151).
Measured per `call()`
+ against the generated closure class it replaces, a capturing closure
improved from dynamic ~3.2× /
+ `@CompileStatic` ~1.75× to dynamic ~1.9× / `@CompileStatic` ~0.78× (faster
than a normal closure under
+ `@CompileStatic`), matching the non-capturing figures above.
+* The remaining ~2× dynamic gap is the argument-array spreader plus the
dynamic MOP `call`→`doCall`
+ selection (`PackedClosure` is not a `GeneratedClosure`) — no longer
allocation. A typed per-arity
+ `invokeExact` path would remove the spreader for the common `each`/`collect`
arities: the *same*
+ per-arity handle-selection primitive that default-parameter packing and the
MethodClosure alignment
+ need (see _Unify the two writers_ and _Excluded and deferred features_), so
that throughput work and
+ those follow-ons build one shared mechanism.
=== Security