Claus Ibsen created CAMEL-26938:
-----------------------------------

             Summary: camel-jbang - faster cmd actions: shorter action polls on 
both sides
                 Key: CAMEL-26938
                 URL: https://issues.apache.org/jira/browse/CAMEL-26938
             Project: Camel
          Issue Type: Sub-task
          Components: camel-jbang
            Reporter: Claus Ibsen
             Fix For: 4.24.0


Measured on 2026-11-13 with the unpacked 4.24.0-SNAPSHOT camel-launcher on 
macOS (Apple M4 Pro, JDK 25), warm CDS archives, medians of 5-9 runs on a 
machine with other load (treat as +/-30 %). Estimates are marked as such. Paths 
are relative to {{dsl/camel-jbang/}}.

Every {{camel cmd}} action and every runtime tool of the MCP server that asks 
the integration goes through files:

* {{ActionClient}} sleeps 100 ms before the first check and polls every 100 ms 
({{POLL_INTERVAL = 100}}, line 51, and around line 260).
* The connector looks for action files every 100 ms 
({{FileCliConnectorTransport.ACTION_POLL_MS = 100}}, line 84).

So an action costs 105-112 ms even in a warm JVM (measured in a resident JVM: 
cmd send 105-119 ms, the MCP runtime tools 100-210 ms), and a native or 
resident client cannot get below it.

Proposal: first check after about 5 ms, then 10-20 ms on the client; 20 ms in 
the connector (its idle CPU is 0.6 % today), or a WatchService. Expected about 
-80 ms per action (estimate). The WebSocket transport of the connector already 
answers by requestId with no polling, and could be the transport of a resident 
client.

_Claude Code on behalf of Claus Ibsen_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to