Skip to content

Conversation

kilink
Copy link
Contributor

@kilink kilink commented Sep 9, 2024

Avoid empty array allocations in a few places in AnnotationTypeMapping.

In a heap dump for a production app, there were a couple hundred empty int arrays referenced from AnnotationTypeMapping instances (~3kb of waste); there were also about ~60 empty MirrorSet arrays (~1kb of waste).

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Sep 9, 2024
@bclozel bclozel added in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Sep 9, 2024
@bclozel bclozel added this to the 6.2.0-RC1 milestone Sep 9, 2024
@sdeleuze
Copy link
Contributor

sdeleuze commented Sep 10, 2024

@kilink Any chance you could provide a feedback on my question above? If not, I plan to merge your PR without the commented change.

@kilink
Copy link
Contributor Author

kilink commented Sep 10, 2024

@kilink Any chance you could provide a feedback on my question above? If not, I plan to merge your PR without the commented change.

Sorry, have been somewhat busy and hadn't got a chance to look at it. What you said it probably correct, I was likely just over-aggressive in trying to eliminate possible empty array allocations here. I can push up a change that removes that line.

Avoid empty array allocations in a few places in AnnotationTypeMapping.
@kilink kilink force-pushed the annotation-type-mapping-empty-array-allocations branch from 10e841e to 66b5741 Compare September 10, 2024 16:44
@kilink
Copy link
Contributor Author

kilink commented Sep 10, 2024

I double-checked, I only see the problem in AnnotationTypeMapping (and indirectly TypeMappedAnnotation):

image

I went ahead and reverted that line.

@sdeleuze sdeleuze closed this in 7827188 Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants