Skip to content

[ty] Store interpolated string elements in boxed slices - #27599

Closed
charliermarsh wants to merge 1 commit into
mainfrom
charlie/box-interpolated-string-elements
Closed

charliermarsh wants to merge 1 commit into
mainfrom
charlie/box-interpolated-string-elements

Conversation

@charliermarsh

Copy link
Copy Markdown
Member

Summary

Store f-string and t-string elements as a boxed slice after parsing instead of retaining a growable Vec.

The collection is never extended after construction. Boxing it discards spare capacity and reduces the retained collection handle from 24 to 16 bytes on 64-bit targets.

Extracted from #27591.

@astral-sh-bot

astral-sh-bot Bot commented Aug 8, 2026

Copy link
Copy Markdown

Memory usage report

Summary

Project Old New Diff Outcome
flake8 40.38MB 40.36MB -0.06% (23.23kB) ⬇️
trio 93.28MB 93.24MB -0.04% (34.85kB) ⬇️
sphinx 164.92MB 164.86MB -0.04% (66.70kB) ⬇️
prefect 453.68MB 453.48MB -0.05% (209.47kB) ⬇️

Significant changes

Click to expand detailed breakdown

flake8

Name Old New Diff Outcome
parsed_module 15.50MB 15.48MB -0.15% (23.23kB) ⬇️

trio

Name Old New Diff Outcome
parsed_module 23.25MB 23.22MB -0.15% (34.85kB) ⬇️

sphinx

Name Old New Diff Outcome
parsed_module 34.30MB 34.24MB -0.19% (66.70kB) ⬇️

prefect

Name Old New Diff Outcome
parsed_module 89.10MB 88.90MB -0.23% (209.47kB) ⬇️

@astral-sh-bot

astral-sh-bot Bot commented Aug 8, 2026

Copy link
Copy Markdown

ecosystem-analyzer results

No diagnostic changes detected ✅

Flaky changes detected. This PR summary excludes flaky changes; see the HTML report for details.

Full report with detailed diff (timing results)

@astral-sh-bot

astral-sh-bot Bot commented Aug 8, 2026

Copy link
Copy Markdown

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

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.

1 participant