File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
src/main/java/org/codehaus/groovy/vmplugin/v8 Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 5353public class IndyInterface {
5454 private static final long INDY_OPTIMIZE_THRESHOLD = SystemUtil .getLongSafe ("groovy.indy.optimize.threshold" , 10_000L );
5555 private static final long INDY_FALLBACK_THRESHOLD = SystemUtil .getLongSafe ("groovy.indy.fallback.threshold" , 10_000L );
56+ /**
57+ * Initial capacity for the call site registry. Default 1024 is a reasonable size for
58+ * typical applications, avoiding resizing during startup while not over-allocating.
59+ */
60+ private static final int INDY_CALLSITE_INITIAL_CAPACITY = SystemUtil .getIntegerSafe ("groovy.indy.callsite.initial.capacity" , 1024 );
5661
5762 /**
5863 * flags for method and property calls
@@ -176,7 +181,7 @@ public static CallType fromCallSiteName(String callSiteName) {
176181 * Weak set of all CacheableCallSites. Used to invalidate caches when metaclass changes.
177182 * Uses WeakReferences so call sites can be garbage collected when no longer referenced.
178183 */
179- private static final Set <WeakReference <CacheableCallSite >> ALL_CALL_SITES = ConcurrentHashMap .newKeySet ();
184+ private static final Set <WeakReference <CacheableCallSite >> ALL_CALL_SITES = ConcurrentHashMap .newKeySet (INDY_CALLSITE_INITIAL_CAPACITY );
180185
181186 static {
182187 GroovySystem .getMetaClassRegistry ().addMetaClassRegistryChangeEventListener (cmcu -> invalidateSwitchPoints ());
You can’t perform that action at this time.
0 commit comments