-
Notifications
You must be signed in to change notification settings - Fork 38.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure indexer output is deterministic and repeatable #22383
Conversation
Any feedback on this PR? The current behavior is preventing us from adopting |
I had a chat with @wilkinsona as we have a similar requirement for Spring Boot. I am not a huge fan of the manual handling and assuming that values are not multi-lines. I hadn't enough cycles to try to improve it though but perhaps you do? |
Out of curiosity, have you actually noticed a significant improvement using the indexer? If so, can you share a bit more details? |
On application with over 1000 beans I've observed an improvement in startup time of roughly half a second. In relative terms that is around 3%, so quite measurable. I'm not a fan of manual handling of writing |
With #23018 now resolved, I assumed this is unblocked and can be addressed in The only question is how to leverage the new |
I don't think it is so we'll have to decide what we want to do here and if we accept copy/pasting this. |
I don't foresee any real issue with having a copy of The only dependency that would need to be worked around is the current use of |
Assuming copy of |
Maybe something as simple as The reason I used |
5ac50c8
to
b8d1441
Compare
I've update the PR to take the approach with a copy of |
Looks fine to me.
I actually pushed the same change to |
...xer/src/test/java/org/springframework/context/index/processor/PropertiesMarshallerTests.java
Outdated
Show resolved
Hide resolved
b8d1441
to
7ec23d6
Compare
The output file that
spring-context-indexer
produces is currently written usingProperties#store
. This prevents the build of a project that uses indexer from being repeatable, due to current timestamp being included in comment inside output file, and also entries possibly not being ordered deterministically.This PR ensures that indexer output is written in deterministic and repeatable manner by filtering out comments and ordering entries.