#54207: perf: build converted objects with interned keys
Merged
Created: Sep 22, 2026, 10:43:49 AM
Merged: Sep 22, 2026, 11:51:55 AM
4 comments
Target: main
Description of Change
Returning a struct (Rect, Point, Size, Insets, Display) went through gin_helper::Dictionary::Set per field: a generic Object::Set that walks the prototype chain, with the key re-internalized (hashed + string-table probe) on every call.
gin_helper::InternedString: per-isolate cache of the key handle for a string literal.gin_helper::ObjectBuilder:CreateDataPropertyon a fresh object with interned keys. Same shape/prototype as an object literal.- gfx converters switched over.
Testing build, ns/call:
| call | before | after |
|---|---|---|
win.getBounds() |
4197 | 2304 |
screen.getPrimaryDisplay() |
31014 | 12830 |
Checklist
- I have built and tested this change
- I have filled out the PR description
- I have reviewed and verified the changes
-
npm testpasses
Release Notes
Notes: Improved the performance of APIs that return rectangles, sizes, points and display objects.
Backports
Semver Impact
Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.
Semantic Versioning helps users understand the impact of updates:
- Major (X.y.z): Breaking changes that may require code modifications
- Minor (x.Y.z): New features that maintain backward compatibility
- Patch (x.y.Z): Bug fixes that don't change the API
- None: Changes that don't affect using facing parts of Electron