Skip to content

builder: add size tests for startup work removed by interp - #5983

Merged
davecheney merged 1 commit into
tinygo-org:devfrom
davecheney:davecheney-init-size-coverage
Oct 22, 2026
Merged

davecheney merged 1 commit into
tinygo-org:devfrom
davecheney:davecheney-init-size-coverage

Conversation

@davecheney

@davecheney davecheney commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Recent changes that let interp move startup work to compile time did
not show up in TestBinarySize, so their savings went unmeasured and a
regression would go unnoticed. These samples cover the RP2 targets,
ESP32-C3, slice growth and os. Their sizes match on Go 1.25 to 1.27.

Run against the commits before and after each change, these rows show
(code/rodata bytes, opt=z):

@jakebailey

Copy link
Copy Markdown
Member

I sort of didn't include any of this stuff in the size tests on purpose, because then the results depend on the Go version used to compile the code, hence why my test was import-free.

Is this actually stable?

@davecheney

Copy link
Copy Markdown
Contributor Author

I sort of didn't include any of this stuff in the size tests on purpose, because then the results depend on the Go version used to compile the code, hence why my test was import-free.

Is this actually stable?

good question, let me check

@davecheney
davecheney force-pushed the davecheney-init-size-coverage branch from cec4d7c to a6a870e Compare October 22, 2026 01:29
@davecheney

Copy link
Copy Markdown
Contributor Author

@jakebailey Good catch. size-sha256 changed with every Go version, even between 1.27.1 and 1.27.3, so I removed it.
The remaining rows are the same on Go 1.25, 1.26 and 1.27. size-os imports os, but the code it measures is in TinyGo's src/os.

@davecheney
davecheney force-pushed the davecheney-init-size-coverage branch from a6a870e to 5c40534 Compare October 22, 2026 06:43
@davecheney davecheney added this to the 0.44 milestone Oct 22, 2026
@davecheney

Copy link
Copy Markdown
Contributor Author

@deadprogram @jakebailey PTAL. I've removed the sha256 test, it was unstable across all Go versions, the other size tests were tested across several Go versions and are stable so they shouldn't introduce flakes.

I'd like to land this soon to lock in the interp improvements that have landed in 0.44-dev

@jakebailey jakebailey left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If it's stable, seems fine

@davecheney

Copy link
Copy Markdown
Contributor Author

If it's stable, seems fine

🫡 i'll watch them like a hawk. Any funny business and they're out.

Recent changes that let interp move startup work to compile time did
not show up in TestBinarySize, so their savings went unmeasured and a
regression would go unnoticed. These samples cover the RP2 targets,
ESP32-C3, slice growth and os. Their sizes match on Go 1.25 to 1.27.

Run against the commits before and after each change, these rows show
(code/rodata bytes, opt=z):

- tinygo-org#5837 RP2 PLL: pico -1308/-548, pico2 -1128/-552 (opt=2 code -5 to
  -6 KB). Visible only with tinygo-org#5975.
- tinygo-org#5963 llvm.ctlz: pico -818/-142, pico2 -754/-142, size-slice -163/-5.
- tinygo-org#5973 os temp file seed: pico2 size-os -16 (opt=2 -32).
@davecheney
davecheney force-pushed the davecheney-init-size-coverage branch from 5c40534 to 966401a Compare October 22, 2026 21:31
@davecheney
davecheney merged commit a990a9d into tinygo-org:dev Oct 22, 2026
31 checks passed
@davecheney
davecheney deleted the davecheney-init-size-coverage branch October 22, 2026 23:49
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