#54209: perf: send to the main frame without crossing the boundary twice
Merged
Created: Sep 22, 2026, 10:44:14 AM
Merged: Sep 22, 2026, 11:48:33 AM
4 comments
Target: main
Description of Change
webContents.send() went through the mainFrame accessor (a full binding call that looks up/creates the WebFrameMain wrapper) and then a second binding call to _send. Resolve the primary main frame in C++ so a send crosses the boundary once. Channel validation and error handling move to the webContents wrapper unchanged: a destroyed contents / missing frame still throws a TypeError, a serialization failure is still logged.
Roughly 250 ns off each send on a testing build; the rest of a send is serialization and mojo.
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: none
Backports
44-x-y
In-flight45-x-y
MergedPR Number
#54212Merged At
Sep 22, 2026, 1:01:43 PM
Released In
v45.0.0-alpha.11Release Date
Sep 22, 2026, 8:14:26 PM
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