gnodet opened a new pull request, #12542: URL: https://github.com/apache/maven/pull/12542
## Summary - Replace `CopyOnWriteArrayList` with `LinkedHashMap` for key ordering in `OrderedProperties` - `CopyOnWriteArrayList.contains()` is O(n), making every `put()` call O(n) and `putAll()` O(n²) - `LinkedHashMap` provides O(1) put/contains/remove while preserving insertion order - Eliminates custom `KeySet`/`EntrySet` inner classes — `LinkedHashMap` views handle this natively **JFR profiling** shows `WrapperProperties` consuming ~13% of CPU during `mvn validate` on Apache Camel (676 modules), primarily from the O(n²) `putAll` path triggered by `keySet()`/`entrySet()`/`values()` which each create a new `OrderedProperties` copy. > Stacked on #12540 ## Test plan - [x] `mvn test -pl compat/maven-model` — all tests pass - [x] `mvn test -pl impl/maven-impl` — 466 tests pass - [x] `mvn test -pl compat/maven-model-builder` — 166 tests pass 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
