[
https://issues.apache.org/jira/browse/CAMEL-26428?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Claus Ibsen resolved CAMEL-26428.
---------------------------------
Resolution: Fixed
Fixed by https://github.com/apache/camel/pull/28763 (0fd7d9abf9c2). A command
line creates only the command it runs, and the launcher skips the commands of
the embedded plugins for it; the help, a command line that starts with an
option, shell, completion, and the commands that use the plugins (run, export,
cmd) still create all commands.
_Claude Code on behalf of davsclaus_
> camel-jbang - The CLI creates only the command that the command line runs
> -------------------------------------------------------------------------
>
> Key: CAMEL-26428
> URL: https://issues.apache.org/jira/browse/CAMEL-26428
> Project: Camel
> Issue Type: Improvement
> Components: camel-jbang
> Reporter: Claus Ibsen
> Assignee: Claus Ibsen
> Priority: Minor
> Fix For: 4.24.0
>
>
> The CLI creates all its commands (143 in camel-jbang-core, plus the commands
> of the plugins embedded in the launcher) on every run, also when the command
> line runs one of them, such as {{camel version}} or {{camel ps}}. Creating
> them loads their classes and builds the picocli model of each.
> Measured on main (JDK 25), with CAMEL-26427: the model of the commands is
> about 490 ms of a {{camel version}} of 566 ms (about 230 ms loading and
> creating the command classes, about 115 ms the picocli model, about 150 ms
> the commands of the embedded plugins, mostly the monitor of the TUI).
> Creating only the commands that run takes a few milliseconds.
> The CLI should create only the command that the command line names, and all
> commands for the help, a command it does not know (a plugin, or a typo), and
> the commands that use the other commands or the plugins (shell, completion,
> run, export, cmd).
> Found while measuring the startup for CAMEL-23810.
> _Claude Code on behalf of davsclaus (Claus Ibsen)_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)