Skip to content

Perf/a b optimizations - #10

Merged
abcsnowwolf merged 3 commits into
mainfrom
perf/a-b-optimizations
Aug 5, 2026
Merged

Perf/a b optimizations#10
abcsnowwolf merged 3 commits into
mainfrom
perf/a-b-optimizations

Conversation

@abcsnowwolf

Copy link
Copy Markdown
Contributor

No description provided.

* keep the parsed request document and view params into it instead of
  deep-copying params into a second JsonDocument
* serialize responses directly rather than assembling them in a wrapper
  document, removing another full-payload deep copy per reply
* answer tools/list from a body serialized once per tool-set change,
  invalidated by RegisterTool; the cache is unsynchronized, so document
  the single-task invariant it relies on
* add parseRequest(const char*) so neither transport builds a throwaway
  std::string of the whole request body
* add RegisterTool(Tool&&) to skip the schema-tree deep copy
* add MCP_OMIT_TEXT_WHEN_STRUCTURED to drop the duplicated text mirror of
  a structured result, built and asserted by env:native-omit-text
* offer a 517-byte preferred ATT MTU (BleServerConfig::preferredMtu);
  fragment count scales directly with the negotiated MTU, now measured by
  a transport test rather than asserted in a comment
* default BleServerConfig::txGapTicks to 0, replacing the unconditional
  1-tick inter-fragment delay that cost ~430 ms per 8 KiB message
* answer a tools/call inline when it completes within
  MCP_HTTP_FAST_PATH_WAIT_MS instead of waiting for the ~500 ms
  connection poll that drives the deferred filler
* raise the RX baseline to 512 and only release growth past 4x baseline,
  ending the grow/shrink churn around the old 256-byte baseline
* make the BLE worker stack size configurable (MCP_BLE_WORKER_STACK_SIZE)
* keep the tool map on plain std::map<std::string, Tool>: std::less<> is
  C++14 and MCPServer.h compiles as part of the consumer sketch, which the
  ESP32 Arduino framework still builds as gnu++11
* match the real NimBLE 2.x setMTU signature (bool, not int) in the mock
* add scripts/coverage.sh plus env:native-cov and a CI gate at 80% line
  coverage (currently 89.0%)
* replace me-no-dev/ESPAsyncWebServer@^1.2.4 and me-no-dev/AsyncTCP@^1.1.1
  with ESP32Async/ESPAsyncWebServer@^3.6.0 and ESP32Async/AsyncTCP@^3.3.2
  across README, both HTTP examples, and the CI/publish build matrices;
  the upstream repos were archived on 2025-01-20 and the old carets pinned
  the pre-archive 1.x releases forever
* refresh the deferToolCall comment: the beginChunkedResponse `if(_version)`
  fallback is unchanged in 3.12.0, so only the stale version pin is dropped
* correct the 411 rationale in README — chunked request bodies landed in
  3.11, so document the real reason (the body buffer is sized from the
  declared length, which is what keeps MCP_HTTP_MAX_BODY_SIZE enforceable
  before any allocation)
* bump to 0.5.1: the library source is unchanged and still compiles against
  either fork, so this is a documentation-only patch release
* origin/main (95ea4b8) is a rebased duplicate of this branch's 0d05c49 —
  identical trees, different hashes — so every conflict was this branch's
  new value against main's stale copy of the same baseline
* resolved all three conflicts in favour of this branch: the ESP32Async
  dependency coordinates in README/http_echo and version 0.5.1 in
  library.json
* the merge result tree is byte-identical to a474742, so nothing from main
  was dropped
@abcsnowwolf
abcsnowwolf merged commit 91c24b7 into main Aug 5, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant