Skip to content

Flip Intl, Temporal and %AsyncFromSyncIteratorPrototype% to builtin shapes#2597

Merged
lahma merged 2 commits into
sebastienros:mainfrom
lahma:perf-shape-host-sweep
Jul 7, 2026
Merged

Flip Intl, Temporal and %AsyncFromSyncIteratorPrototype% to builtin shapes#2597
lahma merged 2 commits into
sebastienros:mainfrom
lahma:perf-shape-host-sweep

Conversation

@lahma

@lahma lahma commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Flip Intl, Temporal and %AsyncFromSyncIteratorPrototype% to builtin shapes

Completes the host sweep for the builtin-shape system: after #2590 made intrinsic references and throwers expressible as Factory slots, three generator-emitted hosts were still on the dictionary path for no remaining reason:

  • Intl — 10 lazy intrinsic references (Collator … Segmenter) + getCanonicalLocales/supportedValuesOf + @@toStringTag
  • Temporal — 9 lazy intrinsic references + @@toStringTag
  • %AsyncFromSyncIteratorPrototype%next/return/throw

Each now gets [JsObject(UseShape = true)]: process-shared layout, per-realm descriptor array, no per-realm PropertyDictionary.

Results (BenchmarkDotNet default jobs)

IntlColdStartBenchmark (fresh engine per op): −1.07…−1.08 KB allocated per row (−4.3%) across all five benchmarks, time neutral. EngineConstructionBenchmark byte-identical — these hosts are lazily initialized, so engine construction never touches them.

Audited and skipped

  • RegExpConstructor: its Initialize hand-rolls 21 Annex B legacy accessors ($1$9, $`, $&, …) via raw SetProperty; a flip would need an instance slot per accessor. Low value for the churn — left on the dictionary path with this note.
  • JsSegments: per-call instance (returned by Intl.Segmenter.prototype.segment), not a per-realm singleton, and no representative workload traffic.
  • Math/JSON/Reflect/Atomics/GeneratorPrototype/AsyncGeneratorPrototype/TemporalNow already use BuiltinShapeObject storage — nothing to do.

Rider

ExperimentalFeature.Generators [Obsolete] escalated to error: true — the flag has been a no-op since generators became fully supported; escalation stages its removal for the next major. No in-repo consumers; Jint.Tests.PublicInterface green after the change.

Testing

  • Full test262: 99,260 passed, 0 failed, 133 skipped
  • Jint.Tests, Jint.Tests.PublicInterface, Jint.Tests.SourceGenerators green
  • Smoke: Object.getOwnPropertyNames(Intl)/(Temporal) key order identical to the dictionary path; formatters construct and format; @@toStringTag intact

🤖 Generated with Claude Code

https://claude.ai/code/session_01S2U2y9voMQV9rvCkYeQbka

…hapes; escalate obsolete Generators flag

The three remaining generator-emitted dictionary hosts whose members became
expressible with Factory slots (sebastienros#2590): Intl (10 intrinsic refs + 2 functions),
Temporal (9 intrinsic refs) and %AsyncFromSyncIteratorPrototype% (3 functions).
Intl cold-start allocations drop ~1.1 KB per fresh-engine format call (-4.3%);
engine construction is unaffected (hosts are lazy).

Audited and skipped: RegExpConstructor (21 hand-rolled legacy accessors like
$1-$9 would need instance slots; low value), JsSegments (per-call instance,
no representative traffic). Math/JSON/Reflect/Atomics/Generator prototypes
already use BuiltinShapeObject.

Rider: ExperimentalFeature.Generators [Obsolete] escalated to error: true
(flag has been a no-op; removal candidate for next major).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S2U2y9voMQV9rvCkYeQbka
@lahma
lahma enabled auto-merge (squash) July 7, 2026 08:24
@lahma
lahma merged commit 26a0269 into sebastienros:main Jul 7, 2026
4 checks passed
@lahma
lahma deleted the perf-shape-host-sweep branch July 7, 2026 09:01
lahma added a commit that referenced this pull request Jul 8, 2026
Re-run after the builtin-shapes rollout and the 2026-07 performance
campaign (#2580-#2597). Highlights vs the 4.11.0 refresh: minimal script
-47% time / -45% allocation (prepared execution now under a microsecond),
evaluation -33% allocation, stopwatch-modern -22% (ahead of NiL.JS, 1.13x
behind Jurassic, from 1.44x), object-string -14%, string-base64 -12%
(taking the lead from NiL.JS), object-array -11%. Competitor versions
unchanged; their rows served as thermal canaries.


Claude-Session: https://claude.ai/code/session_01S2U2y9voMQV9rvCkYeQbka

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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