davsclaus opened a new pull request, #29890:
URL: https://github.com/apache/camel/pull/29890

   ## What
   
   CAMEL-26942. A design doc, `design/cli-short-commands.adoc`, on running the 
short commands of the Camel CLI (`get`, `ps`, `log`, `doc`, the `cmd` actions, 
...) without a JVM start. It compares a resident daemon with a GraalVM native 
front for those commands, and adds the doc to the list of design docs in 
`AGENTS.md`.
   
   Docs only, no code.
   
   ## Measurements
   
   A prototype daemon (`CliRunner` served over a Unix socket, with `nc -U` as 
the client) against a new JVM, with an integration running:
   
   | Command | New JVM | Daemon |
   |---|---|---|
   | `version` | 0.15 s | 26-30 ms |
   | `ps --json` | 0.25 s | 28 ms |
   | `get route --json` | 0.28 s | 27 ms |
   | `doc timer` | 0.26 s | 37 ms |
   | `validate yaml` | 0.42 s | 73 ms |
   
   A daemon also needs a client that starts. `nc` cannot ship (Windows has 
none), so a second run compared clients:
   
   | Client | `version` | `ps --json` | `doc timer` |
   |---|---|---|---|
   | None: a new JVM | 0.146 s | 0.140 s | 0.265 s |
   | `nc -U` (stands in for a native client) | 21 ms | 22 ms | 31 ms |
   | Java client | 56 ms | 59 ms | 65 ms |
   | Java client, AOT cache, C1, SerialGC | 51 ms | 50 ms | 59 ms |
   
   The native front has no prototype, because the test machine has no GraalVM. 
It is estimated at 10-40 ms per command, and 6-8 weeks of work.
   
   ## Recommendation in the doc
   
   1. Finish CAMEL-26937 (the startup quick wins) and CAMEL-26940 (the AOT 
cache) first, then measure the agent loop again.
   2. Then build the daemon, opt-in, in stages:
      - the read-only commands with a Java client;
      - the directory, environment and terminal of each request;
      - child processes and readiness pushed over the WebSocket transport;
      - a native client (as mvnd does) only if the 50 ms of the Java client 
still matters.
   3. Not the native front. A daemon with a native client is as fast. The 
native front needs:
      - changes to the base classes of the commands;
      - GraalVM metadata kept in step with every command;
      - a change in aesh;
      - binaries per platform in every release.
   
   The decision comes after step 1: is the daemon worth a process in the 
background? It would take about 1 s more off a loop of about 3 s (estimate).
   
   _Claude Code on behalf of Claus Ibsen (davsclaus)_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_012nJsFsjqqFiwroeHRWaKbS
   


-- 
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]

Reply via email to