Repository navigation
perf(wire): the ENC28J60 sends a frame while the one before is on the wire - #276
Merged
Merged
Conversation
… wire src/net/Enc28j60Device.h takes the module's receive buffer from 0x1A00 to 0x141C, the default of PicoENC28J60 since 1.3.0. That is three full-size frames to receive instead of four, and room for two to send from. The library's lwIP interface needs two to put a frame into the chip while the one before is on the wire. #275 kept 0x1A00, and its room for one frame, for the maintainer to choose. 0x1A00 was there for flash writes: they hold the interrupts off, and four frames is as many as TCP_WND lets a sender have in flight. Measured on the bench on 2026-10-15: a Pico W with an ENC28J60 on the cable, INT on GP11, library 1.3.1, no other client. main against this change: pico_wiretft (9ab9e315 against 8f3886c2, the image these lines build): - 32 KB uploads, written to LittleFS while they arrive, 3 runs of 20, each read back whole: medians 1,598 / 1,636 / 1,648 ms against 1,635 / 1,590 / 1,620. The same. - /lang.js (12.4 KB), one download at a time: 33.8 ms against 32.3. - Four clients fetching pages on fresh connections for 300 s: 10,051 / 9,667 / 9,076 pages against 10,444 / 10,554. - HTTPS with a bench pair: 20 of 20 requests on fresh connections, and 1,000 of 1,000 reads on one, at a 31 ms median on both. pico_wire (f7be7f4b against 3fe223cb): - Uploads: 1,733 / 1,735 ms against 1,685. - /lang.js: 33.2 ms against 31.7. No run had a failure, a tcp_write out of memory or a restart. On both images, 1,000 reads of /api/status, the 34-route sweep and the reboot reply are what they were. Sizes do not change: flash used, .bin and RAM of both wired images are main's. The seven radio images are byte for byte main's (17bd31c), compared by sha256. The gates job, run locally, has 45 steps OK. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013C6NHM2fJi3M7EMr47WyQ3
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 SIMUT Wire's ENC28J60 module moves its receive buffer from
0x1A00to0x141C, the default ofPicoENC28J60since 1.3.0. It now receives three full-size frames instead of four, and has room for two to send from. The library's lwIP interface needs that room to put a frame into the chip while the one before is on the wire; #275 kept0x1A00, with room for one, for the maintainer to choose.0x1A00was there for flash writes. They hold the interrupts off, and four frames is as many asTCP_WNDlets a sender have in flight. So the test that matters is a receive with flash writes in it, next to the sending that this change speeds up.Tests on the bench, 2026-10-15
The target is a Pico W with an ENC28J60 on the cable, INT on GP11, library 1.3.1, and no other client on the port. Each image of main runs against the same image with this change.
pico_wiretft(main 9ab9e315 against 8f3886c2, the image this branch builds)0x1A000x141C/lang.js, 12.4 KB, one download at a time; medians of 50/login, 6.7 KB/api/statusreader beside that load, medianpico_wire(main f7be7f4b against 3fe223cb)0x1A000x141C/lang.jsWhat the tests show
tcp_write sem memoriaor a restart./api/statuson one connection, the 34-route GET sweep (status, headers and chunk count) and the reboot reply ({"ok":true}, whole, over HTTP and over TLS) are what they were.The load and download clients close each connection once the body is whole, as a browser does. A client that waits for the device to close measures
HTTP_MAX_CLOSE_WAITinstead (#274).On the host
.binand RAM of both wired images are main's. The budgets and the OTA headroom table do not move.SIMUT_NET_ENC28J60is set.Not covered
🤖 Generated with Claude Code
https://claude.ai/code/session_013C6NHM2fJi3M7EMr47WyQ3