| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Lazily initialize primordials when cross-context support for builtins is needed to fix the performance regression in context creation.
| return InitializePrimordials(context); | ||
| } | ||
|
|
||
| bool InitializePrimordials(Local<Context> context) { |
There was a problem hiding this comment.
This block contains only indentation change
Sorry, something went wrong.
Sorry, something went wrong.
| Local<Object> exports = Object::New(isolate); | ||
| if (context->Global()->SetPrivate(context, key, exports).IsNothing()) | ||
| return MaybeLocal<Object>(); | ||
| InitializePrimordials(context); |
There was a problem hiding this comment.
This is only hit for vm contexts and main contexts created without snapshot support so there's no additional cost for the main context built with snapshot support
Sorry, something went wrong.
|
Benchmark CI: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/522/ |
Sorry, something went wrong.
| Local<Object> exports = Object::New(isolate); | ||
| if (context->Global()->SetPrivate(context, key, exports).IsNothing()) | ||
| if (context->Global()->SetPrivate(context, key, exports).IsNothing() || | ||
| !InitializePrimordials(context)) |
There was a problem hiding this comment.
Oops, forgot to handle the return value of InitializePrimordials in the initial commit, fixed.
Sorry, something went wrong.
16:41:47 confidence improvement accuracy (*) (**) (***) 16:41:47 vm/create-context.js n=100 *** 371.94 % ±21.00% ±28.29% ±37.54% 🙂 |
Sorry, something went wrong.
Sorry, something went wrong.
|
@joyeecheung if this should go to v12.x can you please open a manual backport? There are some conflicts i'd rather not chance myself. |
Sorry, something went wrong.
Lazily initialize primordials when cross-context support for builtins is needed to fix the performance regression in context creation. PR-URL: nodejs#31738 Fixes: nodejs#29842 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: David Carlier <devnexen@gmail.com>
| Back | FazBrowse Home | New Git URL |
Lazily initialize primordials when cross-context support for
builtins is needed to fix the performance regression in context
creation.
Fixes: #29842
local benchmark results
Checklist