Skip to content

Repository AOT processing re-traverses the same type graph once per repository and once per resolved type (O(repositories × documents × closure)) #3518

Open

Description

@snuderl

n an application with R Spring Data repositories over T @Document/entity types, repository AOT processing does R × T full deep type-graph traversals and registers the same reflection hints millions of times. On a real service (17 Mongo repositories, ~29 @document classes whose fields reference protobuf-generated, Jackson-annotated types) spring-boot:process-aot takes 62s, of which ~56s is repository hint generation. A synthetic reproducer with 32 documents / 32 repositories takes 33.6s and scales quadratically.

The redundant work produces no additional hints: with dedup applied, the generated reachability-metadata.json is byte-identical while the run drops from 37.5s to 4.8s.

Versions: Spring Boot 4.0.1, Spring Framework 7.0.2, spring-data-commons 4.0.1, spring-data-mongodb 5.0.0, Java 26 (also visible on Boot 4.0.0 / Framework 7.0.1).

Reproducer here https://github.com/snuderl/spring-data-aot-repro/tree/main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions