Skip to content

tests: count string comparison allocations with any garbage collector - #5938

Merged
deadprogram merged 1 commit into
tinygo-org:devfrom
davecheney:davecheney-stringcompare-allocsperrun
Oct 21, 2026
Merged

deadprogram merged 1 commit into
tinygo-org:devfrom
davecheney:davecheney-stringcompare-allocsperrun

Conversation

@davecheney

Copy link
Copy Markdown
Contributor

The test read exact byte counts from runtime.MemStats, so it needed the conservative collector, and a change in how that collector counts bytes could break it, as @deadprogram said in #5784 (comment).

testing.AllocsPerRun gives the same count with every collector, so the test can also run with the default collector of each target, which is boehm on hosts.

The test read exact byte counts from runtime.MemStats, so it needed the conservative collector, and a change in how that collector counts bytes could break it, as deadprogram said in tinygo-org#5784 (comment).

testing.AllocsPerRun gives the same count with every collector, so the test can also run with the default collector of each target, which is boehm on hosts.
@davecheney davecheney added this to the 0.44 milestone Oct 21, 2026

@deadprogram deadprogram 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.

Good stuff @davecheney thank you very much! Now merging.

@deadprogram
deadprogram merged commit a62623b into tinygo-org:dev Oct 21, 2026
31 checks passed
@davecheney
davecheney deleted the davecheney-stringcompare-allocsperrun branch October 21, 2026 10:22
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