Optimize AutoSetNewObjectMetadata
Categories
(Core :: JavaScript Engine, task, P2)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox114 | --- | fixed |
People
(Reporter: jandem, Assigned: jandem)
References
Details
(Whiteboard: [sp3])
Attachments
(2 files)
AutoSetNewObjectMetadata often shows up in profiles. We can make this quite a lot faster for the common case when there's no active metadata builder.
I have some patches for this that improve the micro-benchmark below from ~405 ms to ~345 ms.
function f() {
var obj = {};
var res;
var t = new Date;
for (var i = 0; i < 10_000_000; i++) {
res = Object.getOwnPropertyNames(obj);
}
print(new Date - t);
return res;
}
f();
Updated•3 years ago
|
| Assignee | ||
Comment 1•3 years ago
|
||
If we're not using JSCLASS_DELAY_METADATA_BUILDER, we won't set pending metadata
so AutoSetNewObjectMetadata will be a no-op.
Also adds an assertion to catch these.
| Assignee | ||
Comment 2•3 years ago
|
||
Inline more code and add realm->hasAllocationMetadataBuilder() checks in a
few places.
Removes the prevState_ field beacuse it was always ImmediateMetadata. We now
assert this in the constructor.
This makes a getOwnPropertyNames micro-benchmark about 15% faster.
Depends on D175136
Comment 4•3 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/f3ea7807cf5c
https://hg.mozilla.org/mozilla-central/rev/8872eb50a6b1
Description
•