ckerr

#48456: perf: avoid a little extra work in InvokeIpcCallback()

Merged
Created: Oct 3, 2025, 11:06:51 PM
Merged: Oct 4, 2025, 11:52:54 PM
2 comments
Target: main

Description of Change

Avoid a little extra work in InvokeIpcCallback():

  1. Allocate the node::CallbackScope on the stack instead of the heap by using std::optional instead of std::unique_ptr.
  2. Skip a redundant call to node::Environment::GetCurrent() by passing env to the callback scope's constructor

CC @codebytere, @deepak1556

Checklist

Release Notes

Notes: none.

Backports

39-x-y
Merged
PR Number
#48466
Merged At
Oct 6, 2025, 12:10:08 PM
Released In
v39.0.0-beta.1
Release Date
Oct 6, 2025, 4:34:18 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