Parent: #475 Related benchmark/evidence: #460
Problem
Intl.RelativeTimeFormat validates options at construction but stores normalized values in hidden ordinary properties. Every format, formatToParts, and resolvedOptions call then traverses generic object storage again for locale, numbering system, style, and numeric mode. This adds locking/allocation pressure to a formatter whose resolved state is immutable after construction.
The already-committed representative_intl_relative_time_format_parts boundary performs 6,400 warmed formatToParts calls and consumes every part type/value/unit. On current main, zig-js and system JSC agree on checksum 9262214. Exact-parent zig-js attribution for one 100-job invocation is:
- property-lock acquisitions:
2,338,798 - backing allocations:
1,480,915/206,315,223bytes - current backing:
50,018,290bytes; peak:52,881,058bytes - GC cells:
795,273; collections:30
A single diagnostic sample was 359.3 ms in zig-js versus 22.2 ms in system JSC; this is diagnostic only, not publication evidence.
Scope
- Publish locale, resolved numbering system, style, and numeric mode atomically into an object-owned immutable native record after all observable option reads complete.
- Make steady formatting and
resolvedOptionsconsume that record directly. - Preserve ECMA-402 option observation/coercion order, Unicode extension precedence, output, parts metadata, receiver branding, and error ordering.
- Account/finalize the record through the bounded backing allocator; cover OOM, bounded heap, moving GC, and concurrent read safety.
- Compare exact-parent timing and attribution at the frozen checksum.
Acceptance
- No hidden ordinary options bag remains on newly constructed RelativeTimeFormat objects.
- Focused RelativeTimeFormat/test262, Intl402, OOM, GC movement, concurrent read, TSan, and full unit gates pass.
- Exact-parent benchmark comparison reports checksum equality and quantified retained changes; retain only a real improvement.
- No ICU/system-JSC runtime dependency, global mutable cache, skipped observable hook, or repro-specific shortcut.