Skip to content

Use less flash when the web workflow reads upload sizes and file times - #11626

Merged
dhalbert merged 1 commit into
adafruit:mainfrom
mikeysklar:web-workflow-parse-decimal
Oct 18, 2026
Merged

dhalbert merged 1 commit into
adafruit:mainfrom
mikeysklar:web-workflow-parse-decimal

Conversation

@mikeysklar

@mikeysklar mikeysklar commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

What

The web workflow reads upload sizes and file times with a small loop instead of strtoul().

Why

It saves flash, following @dhalbert's note on #11620 that only the web workflow still used strtoul().

It saves the most on top of #11620.

Flash (.bin bytes) vs. main vs. #11620
Pico W -248 -528
Pico 2 W -304 -544
Metro ESP32-S3 -288 -288
Testing (Metro ESP32-S3, Ubuntu host, 10 runs each) before after
Upload with timestamp, read back, overwrite, delete PASS PASS
Oversized upload with Expect: 100-continue 417 417
Serial console websocket 101 101
Free Python heap after boot 8264656 8264656

Written with Claude Code.

Content-Length and X-Timestamp are plain decimal, so read them with a
small loop. This drops strtoull() from the link, and also strtoul()
on boards where settings.c no longer uses it.

Sec-WebSocket-Version was parsed but never read, so stop parsing it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@mikeysklar
mikeysklar marked this pull request as ready for review October 18, 2026 19:51
@mikeysklar
mikeysklar requested a review from dhalbert October 18, 2026 19:51

@dhalbert dhalbert left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good. I was seeing if the small integer parser could be used elsewhere, or could be combined with what's in settings, but this needs 64-bit results sometimes, etc.

In the long run these might be turned into utility routines that could be shared, but right now there's no one to share them with.

@dhalbert
dhalbert merged commit bfa9443 into adafruit:main Oct 18, 2026
324 checks passed
@mikeysklar
mikeysklar deleted the web-workflow-parse-decimal branch October 19, 2026 00:08
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.

2 participants