Skip to content

Conversation

@graalvmbot
Copy link
Collaborator

@graalvmbot graalvmbot commented Nov 5, 2025

This PR adopts the support added for caching parsed annotations and leverages it to remove caches in AnnotatedObjectAccess and AnnotatedValueSupport.

As hinted by its name, jdk.vm.ci.meta.annotation.AbstractAnnotated#getDeclaredAnnotationInfo only pertains to declared annotations (i.e. ignores inherited annotations). All other annotation caches have been removed as they had no real benefit. This was ascertained by running the following in substratevm-enterprise:

env GRAALVM_HOME=(mx graalvm-home) \
    SKIP_BASE_BUILD=false \
    SKIP_APP_BUILD=false \
    python3 ~/dev/graal/graalvm-tests/test.py -v \
    ../vm-enterprise/tests/native-image/layered-image/basic-tests/layered-image.test

with some extra printfs added to show cache hits and misses:

[annotationDefaultCache] hits=40, misses=5305
[typeAnnotationCache] hits=0, misses=23281
[parameterAnnotationCache] hits=0, misses=5316
[annotationCache] hits=0, misses=0

As expected, the only caches that really mattered were AnnotatedObjectAccess.declaredAnnotationCache and AnnotatedObjectAccess.resolvedAnnotationsCache which are now replaced by the caches in jdk.vm.ci.meta.annotation.AbstractAnnotated and jdk.graal.compiler.annotation.AnnotationValue#annotationCache respectively.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Nov 5, 2025
@graalvmbot graalvmbot force-pushed the ds/GR-71140 branch 16 times, most recently from 175165b to 15260d2 Compare November 10, 2025 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants