Perf/a b optimizations - #10
Merged
Merged
Conversation
* 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.