spring-projects / spring-projects/spring-data-commons

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

Open
#3,518 0 comments 0 reactions 1 assignee View on GitHub

@christophstrobl is already working on this.

Since Aug 3, 2026.

type: bug
Dominant language
Java
Stars
838
Forks
730
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.