Skip to content

Gate the _check-cache verification with #[cfg] instead of cfg!() - #144

Merged
diondokter merged 1 commit into
tweedegolf:masterfrom
WattStep:check-cache-cfg
Oct 10, 2026
Merged

diondokter merged 1 commit into
tweedegolf:masterfrom
WattStep:check-cache-cfg

Conversation

@Jacke-debug

Copy link
Copy Markdown
Contributor

The cfg!() check is a runtime-false condition, so the await inside it still adds a suspend state to get_page_state_cached's state machine, which the optimizer cannot remove. I use a very memory constrained device where optimizations like this matter.

The cfg!() check is a runtime-false condition, so the await inside it
still adds a suspend state to get_page_state_cached's state machine,
which the optimizer cannot remove. The verification code was compiled
into every build. Measured -272 bytes of .text on a thumbv7em firmware.
@diondokter

Copy link
Copy Markdown
Member

Interesting! Makes sense

@diondokter

Copy link
Copy Markdown
Member

Seems like CI thinks it saves 60 bytes. So that's an easy win.

If you see anything else, you're welcome to create more PRs 😄

@diondokter
diondokter merged commit 25c8c04 into tweedegolf:master Oct 10, 2026
5 checks passed
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