Cache the shape of a promise and use it for promise allocation
Categories
(Core :: JavaScript Engine, task)
Tracking
()
People
(Reporter: mgaudet, Assigned: mgaudet)
References
(Blocks 1 open bug)
Details
Attachments
(1 external file)
Rather than taking slow path through hash table
| Assignee | ||
Comment 1•2 hours ago
|
||
Every promise created without an explicit prototype went through
NewObjectWithClassProto, which loads %Promise.prototype% from the global and
then looks up the initial shape for it in the zone's initial shape table. The
prototype load is cheap; the shape table lookup, a hash table lookup per
promise, is what this removes. Promise-heavy code creates promises at a high
rate (by Promise.resolve, Promise.prototype.then, async functions and so on),
so cache the shape on the global, as is done for arrays, functions, bound
functions and RegExps, and allocate with it directly.
On JetStream doxbee-promise in the shell this is a further 3.7% improvement on
top of the preceding patches (33.59 ms to 32.36 ms per iteration).
Updated•2 hours ago
|
Description
•