Optimize Object.defineProperty

VERIFIED DUPLICATE of bug 1303335

Status

()

VERIFIED DUPLICATE of bug 1303335
4 years ago
a year ago

People

(Reporter: jandem, Unassigned)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [qf:p1])

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

4 years ago
See the micro-benchmark below. We're a good bit faster than V8, but JSC is way faster than us:

Safari: 186 ms
SM:     496 ms
d8:     848 ms

A profile shows there are some things we can optimize, and maybe we could self-host parts of defineProperty, but we should also see what JSC is doing here exactly.

This affects the Ember Object.create benchmark (bug 1097376).

var name = "Foo";
var desc = {configurable:true, writable:true, enumerable:false, value:null};
function f() {
    var t = new Date;
    for (var i=0; i<1000000; i++) {
	globalO = {};
	Object.defineProperty(globalO, name, desc);
    }
    print(new Date - t);
}
f();
Created attachment 8566522 [details] [diff] [review]
Use pure version for lookup

It's really unfortunate that NativeHasProperty and NativeGetProperty seems to be relatively slow.

410 -> 319
Created attachment 8566523 [details] [diff] [review]
Use pure version for lookup
Attachment #8566522 - Attachment is obsolete: true

Comment 3

2 years ago
Is this a dupe of bug 772334?
(In reply to Jan de Mooij [:jandem] from comment #0)
> A profile shows there are some things we can optimize, and maybe we could
> self-host parts of defineProperty, [...]

Bug 1303335 has a WIP patch to self-host Object.defineProperty (and Object.getOwnPropertyDescriptor).
Whiteboard: [qf]
Whiteboard: [qf] → [qf:p1]
Depends on: 1303335

Updated

a year ago
Status: NEW → RESOLVED
Last Resolved: a year ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1303335

Updated

a year ago
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.