[
https://issues.apache.org/jira/browse/CAMEL-26435?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Claus Ibsen resolved CAMEL-26435.
---------------------------------
Resolution: Fixed
Fixed by https://github.com/apache/camel/pull/28765 (merged as 2d2be71458a8):
the self-update check no longer creates a logger (so log4j is not configured),
and camel.sh / camel.bat read the Java version from the release file of the JDK
instead of running java -version. With CAMEL-26428, camel version and camel ps
go from about 310 ms to about 175 ms.
_Claude Code on behalf of davsclaus (Claus Ibsen)_
> camel-jbang - The CLI starts log4j for the self-update check, and runs java
> -version before each command
> --------------------------------------------------------------------------------------------------------
>
> Key: CAMEL-26435
> URL: https://issues.apache.org/jira/browse/CAMEL-26435
> Project: Camel
> Issue Type: Improvement
> Components: camel-jbang
> Reporter: Claus Ibsen
> Assignee: Claus Ibsen
> Priority: Minor
> Fix For: 4.24.0
>
>
> Two startup costs of every command of the Camel CLI launcher (found while
> measuring for CAMEL-23810):
> * The self-update check of the launcher calls
> InstallDetector.webInstallerVersionsRoot(), which calls FileUtil.isWindows().
> FileUtil has a static slf4j logger, so loading it initialises log4j in full
> (with its JMX MBeans) before the command runs. That costs about 140 ms on
> each command, and undoes CAMEL-26429 (a command that turns the logging off
> configures log4j only when something logs). camel version takes 310 ms
> instead of 165 ms (JDK 25, M4 Pro).
> * camel.sh runs java -version before each command to check the Java version
> (about 25 ms). The release file of the JDK has the version.
> _Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)