Improve performance for high-overhead clients#91
Open
opticron wants to merge 4 commits intointeractive-matter:masterfrom
Open
Improve performance for high-overhead clients#91opticron wants to merge 4 commits intointeractive-matter:masterfrom
opticron wants to merge 4 commits intointeractive-matter:masterfrom
Conversation
added 4 commits
February 24, 2018 01:08
Don't send a single quote as a string. This could cause extra processing in downstream clients.
This allows faster processing of empty strings ("") and doesn't burden
downstream clients with processing "".
This allows strings to be passed as is instead of being decomposed into individual characters. This is more efficient for some clients and those that don't implement it can fall back on the default print implementation.
This pushes strings without characters that need to be escaped directly to the Print implementation instead of decomposing them anyway. This can greatly improve performance for clients with significant per-call overhead.
opticron
pushed a commit
to opticron/ESP8266HueEmulator
that referenced
this pull request
Apr 29, 2018
This removes the requirement to modify the aJson library to get a larger buffer. The default method allocates a buffer for rendering JSON dynamically based on output size. A new method has also been added for applications with less available SRAM (setBufferlessResponses). This requires no large fixed or dynamic buffer, but increases response rendering time by close to two orders of magnitude due to inefficiencies and overhead in the WiFiClient and aJson. With the following PR in place, this is reduced to an order of magnitude difference (50ms vs 400ms for /api): interactive-matter/aJson#91
opticron
pushed a commit
to opticron/ESP8266HueEmulator
that referenced
this pull request
Apr 30, 2018
This removes the requirement to modify the aJson library to get a larger buffer. The default method allocates a buffer for rendering JSON dynamically based on output size. A new method has also been added for applications with less available SRAM (setBufferlessResponses). This requires no large fixed or dynamic buffer, but increases response rendering time by close to two orders of magnitude due to inefficiencies and overhead in the WiFiClient and aJson. With the following PR in place, this is reduced to an order of magnitude difference (50ms vs 400ms for /api): interactive-matter/aJson#91
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.
While trying to write a printer to render objects directly to a web stream, I encountered these performance issues. Rendering time went from >1.5s to <0.4s with these changes due to reduction in the number of calls into the web client interface.