gnodet opened a new pull request, #13924: URL: https://github.com/apache/maven/pull/13924
## Problem `LookupInvoker.doInvoke()` calls `createTerminal()` which starts the FFM terminal build on a background thread (`FastTerminal`) and then immediately blocks on `getTerminal()`. Nothing useful happens between start and block, so the async machinery is a no-op and the full FFM cold-start cost is paid serially. FFM cold-start cost on Java 22 (fresh JVM, before JIT warmup) is ~225 ms with the companion JLine fix ([jline/jline3#2424](https://github.com/jline/jline3/pull/2424)), or ~2600 ms without it. Either way, this is currently dead time blocking Maven startup. ## Fix Split `createTerminal()` into two protected final methods: - **`startTerminalBuild(context)`** — calls `MessageUtils.systemInstall()` to kick off the background thread. Must be called after `configureLogging()` (the builder lambda captures `context.coloredOutput`). - **`awaitTerminal(context)`** — blocks on `MessageUtils.getTerminal()`, registers the terminal, and sets up the build log appender. `doInvoke()` now does: ``` configureLogging() startTerminalBuild() ← FFM thread starts here activateLogging() ← runs in parallel with FFM thread helpOrVersionAndMayExit() ← runs in parallel with FFM thread preCommands() ← runs in parallel with FFM thread awaitTerminal() ← block here, just before container() container() ``` `createTerminal()` is preserved as a combined `startTerminalBuild + awaitTerminal` for subclasses. ## Relationship to JLine fix This change provides meaningful parallelism even with the current JLine. With [jline/jline3#2424](https://github.com/jline/jline3/pull/2424) (lazy FFM handle init), the two fixes compound: the FFM thread finishes faster *and* Maven does real work while it runs. -- 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]
