Optimize JSFunction allocation in Stencil
Categories
(Core :: JavaScript Engine, task, P1)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox86 | --- | fixed |
People
(Reporter: tcampbell, Assigned: tcampbell)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
For large JS files, we can have 10's of thousands of individual functions. Even with syntax parsing, we must allocate a JSFunction for each when we instantiate the CompilationStencil. Currently we use NewFunctionWithProto which is quite general purpose and involves many hashtable lookups for shape, group, etc. With stencil we allocate JSFunction in a single batch and nearly all of them have the same shape/group, so we should precompute the shape/group and add a fast path.
Netflix player code is an example that benefits noticeably from this. We can eliminate about 20% of Stencil instantiation time.
| Assignee | ||
Comment 1•5 years ago
|
||
Most parser-generated functions have the same prototype, initial-shape and
group and by caching those values we can speed up JSFunction allocation
significantly.
Updated•5 years ago
|
Comment 3•5 years ago
|
||
| bugherder | ||
Description
•