Skip to content

size: gate Date toLocale* + Intl subclass-super behind intl-namespace (hello −99 KB, crosses under 4.1 MB) - #7009

Merged
proggeramlug merged 3 commits into
mainfrom
size/intl-tolocale-gate
Jul 29, 2026
Merged

size: gate Date toLocale* + Intl subclass-super behind intl-namespace (hello −99 KB, crosses under 4.1 MB)#7009
proggeramlug merged 3 commits into
mainfrom
size/intl-tolocale-gate

Conversation

@proggeramlug

Copy link
Copy Markdown
Contributor

Fourth slice, and the largest single win of the series. #6959 gated the Intl namespace/instanceof/subclass paths, but 164 KB of the Intl web survived — ld64 -why_live pointed at two always-live references that #6959 didn't cover:

  1. Date.prototype.toLocale{,Date,Time}Stringdate_to_locale_opts_implintl::temporal_locale_string. The Date prototype is installed in every binary, so its locale thunks pinned the Intl formatting machinery unconditionally.
  2. The class X extends Intl.<Ctor> super probe in fetch_globals' construct path.

Both now sit behind the existing intl-namespace feature — no new feature, no new detection, because the compiler's detection already fires on every toLocale* / localeCompare / Intl token. With the feature off, the Date thunks defer to the non-locale formatter (unreachable in practice, since reaching them requires a toLocale* token that would have enabled the feature) and the Intl subclass probe can never match (no Intl constructor value can exist).

Measured: hello world 4,344,464 → 4,245,216 (−99 KB). rt::intl drops from 164 KB to near-zero for programs with no locale API.

Verification: a 9-case toLocale* probe — Date.toLocaleDateString/TimeString/String with and without options, Invalid Date, Number.toLocaleString, BigInt.toLocaleString, localeCompare, Array.prototype.toLocaleString — matches Node exactly, except German collation ("ä".localeCompare("z", "de")), which reproduces identically on released perry 0.5.1220 → pre-existing (Perry's localeCompare doesn't do CLDR collation; noted in #6960's family). Serial runtime suite 1509/1509; both feature states compile.

Series total: 4,461,216 → 4,245,216 (−216 KB, −4.8%) across #6980, #6985, #7008 and this PR.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@proggeramlug, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 14 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a026978d-5952-43f5-aa3e-4ceea6c546cf

📥 Commits

Reviewing files that changed from the base of the PR and between c799191 and 211be53.

📒 Files selected for processing (3)
  • changelog.d/7009-intl-tolocale-gate.md
  • crates/perry-runtime/src/object/date_proto_thunks.rs
  • crates/perry-runtime/src/object/global_this/fetch_globals.rs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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