electron/shell
trop[bot] 71150ffe56
perf: have ErrorThrower lazily lookup the current isolate (#46417)
perf: have ErrorThrower lazy-lookup the current isolate

ErrorThrower's default constructor is marked as "should rarely if ever
be used" because it's expensive to call.

Unfortunately, nearly every instance of ErrorThrower comes as an argument
in gin_helper's JS-->C++ function marshalling where a thrower is
default-constructed and then populated in gin_helper::GetNextArgument()
with an assignment operator to a temporary ErrorThrower constructed
with the gin::Arguments' isolate.

tldr: most of the time we use the slow constructor first, then throw
that work away unused by overwriting with a fast-constructed one.

This refactor avoids that cost by deferring the expensive work to
`ErrorThrower::isolate()`, where it happens only as a fallback iff
isolate_ hasn't been set.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-04-01 20:53:22 -05:00
..
app refactor: remove unused system header includes (#46042) 2025-03-15 00:33:33 -05:00
browser perf: cache the return value of IsX11() (#46425) 2025-04-01 17:55:25 -05:00
common perf: have ErrorThrower lazily lookup the current isolate (#46417) 2025-04-01 20:53:22 -05:00
renderer perf: prefer absl::flat_hash_set over std::unordered_set (#46374) 2025-03-31 08:25:16 -05:00
services/node refactor: use private inheritance from mojo::MessageReceiver (#45993) 2025-03-12 23:19:17 -05:00
utility fix: broken OOP window.print() on macOS/Linux (#45259) 2025-01-20 10:37:35 -06:00