MarshallOfSound

#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: CreateDataProperty on 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

Release Notes

Notes: Improved the performance of APIs that return rectangles, sizes, points and display objects.

Backports

44-x-y
In-flight
PR Number
#54215
Waiting to be merged
45-x-y
In-flight
PR Number
#54213
Waiting to be merged

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