On Thu, Aug 27, 2020 at 1:30 AM Jaroslav Tulach
<jaroslav.tul...@gmail.com> wrote:
> Hypothesis: Probably different Ant and Maven integration into the NetBeans 
> IDE.
> While Ant is executed in the same JVM as the IDE in an isolated classloader,
> Maven is probably always started as a separate process.

Yes this likely accounts for a lot of the difference.

For a regular edit-test-edit-test cycle you can use the misleadingly
named “compile on save” feature to save time, but in the case of Maven
projects it still does launch `mvn`, just with a minimal set of mojos.
At one point Maven CoS used the IDE’s built-in test runner
(incidentally implemented with in-JVM Ant), just passing along the
classpath introspected from the POM, but we switched to launching
actual Maven to get better compatibility with projects with subtler
configuration (IIRC).

At any rate, I like the idea of reusing a JVM in the style of `mvnsh`
for repeated Maven invocations in routine developer workflows. It
would be important to keep not only Maven core loaded, but mojo class
loaders, since these are often large and expensive to initialize. You
would have to tune it in various ways, for example

· Shut down automatically after some idle period.
· Avoid sharing an instance between projects.
· Run a regular forked `mvn` for executions that smell production-y,
such as anything using the `clean` or `install` phases.

It is possible that given a warm JVM, we could dispense with any
special CoS tricks and still get reasonable performance from the stock
lifecycle up to the `test` phase. It depends in part on the project
config: if your POM is requesting a ton of plugins run in earlier
phases (CheckStyle, etc.), there will still be lots of overhead unless
the IDE passes a bunch of `-DskipSomething` properties.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org
For additional commands, e-mail: dev-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



Reply via email to