arturobernalg opened a new pull request, #13431:
URL: https://github.com/apache/maven/pull/13431
Fixes #13404.
### Problem
`bin/mvn` and `bin/mvn.cmd` run `JvmConfigParser.java` in source-launch
mode, so the JVM compiles the parser in memory on every invocation of a project
that has a `.mvn/jvm.config`.
Measured on master (JDK 17, empty POM, `mvn -o -q validate`, average of 8
runs):
| | no jvm.config | with jvm.config |
|---|---|---|
| 3.9.14 | 1014 ms | 1050 ms |
| 3.10.0 | 1314 ms | 1173 ms |
| master | 1589 ms | 2235 ms |
| this PR | 1497 ms | 1566 ms |
The parser alone takes about 455 ms in source-launch mode and about 30 ms
precompiled.
### Change
* compile `JvmConfigParser` during the `apache-maven` build and ship
`bin/JvmConfigParser.class` in the distribution instead of the source;
* run it with `-cp "$MAVEN_HOME/bin" JvmConfigParser` from `bin/mvn` and
`bin/mvn.cmd`;
* update the java stub in `test-mvn-path-conversion.sh` to the new
invocation.
The parser source and its output are unchanged. The remaining gap to 3.10
without a `jvm.config` comes from bootstrap class loading and is not addressed
here.
### Testing
* `test-mvn-path-conversion.sh` passes.
* ITs MNG-4559 (both), MNG-5889, MNG-6223, MNG-6255, MNG-8598, gh-10937,
gh-11363 and gh-11485 pass against the built distribution.
* Checked by hand: `|`, quoted values and `${MAVEN_PROJECTBASEDIR}` in
`jvm.config`, and `MAVEN_DEBUG_SCRIPT=1`.
* `mvn.cmd` was changed the same way but not run locally (no Windows
available).
* [ ] I hereby declare this contribution to be licensed under the [Apache
License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
--
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]