Closed Bug 1134611 Opened 10 years ago Closed 8 years ago

Optimize Object.defineProperty

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

VERIFIED DUPLICATE of bug 1303335
Performance Impact high

People

(Reporter: jandem, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

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();
Attached patch Use pure version for lookup (obsolete) — Splinter Review
It's really unfortunate that NativeHasProperty and NativeGetProperty seems to be relatively slow. 410 -> 319
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]
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
Status: RESOLVED → VERIFIED
Performance Impact: --- → P1
Whiteboard: [qf:p1]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: