Repository navigation
Sockets: can-send check with lwIP's select rather than the VFS select - #11
Merged
Merged
Conversation
select() goes through the VFS, which sets up semaphores and checks every VFS driver on each call: about 0.5 ms on an ESP32-S3, against 50 us for lwip_select(). The check is made before each HTTP response and each WebSocket publish. An HTTP request (/api/v) took up to 5.7-6.1 ms of the main loop, and now 2.7-3.2 ms (with QIO flash, which made the rest of the handling faster too). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
The sockets connection's can-send check (
RaftClientConnSockets::canSend()) now callslwip_select()rather thanselect().ESP-IDF's
select()goes through the VFS, which sets up semaphores and checks every VFS driver on each call. That took about 0.5 ms on an ESP32-S3, against at most about 50 µs forlwip_select(). The check runs before each HTTP response and each WebSocket publish.Measured
Plant growth board (ESP32-S3, quad flash in QIO mode), longest
WebServerhold on the main loop, one HTTP request (/api/v) a second:This was meant to go in #10, but was pushed after #10 was merged.
🤖 Generated with Claude Code