Closed Bug 1475570 Opened 6 years ago Closed 5 years ago

Inaccurate warnings related to setting/getting [[Prototype]]

Categories

(Developer Documentation Graveyard :: JavaScript, enhancement, P2)

All
Other
enhancement

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: hh.vadolf, Unassigned)

Details

:: Developer Documentation Request

      Request Type: Correction
     Gecko Version: unspecified
 Technical Contact: 

:: Details

I've ran some [tests][1] to figure out object property iteration speeds and as
an additional interesting result I found out that the community endorsed way of
creating objects with specific prototypes (`Object.create`) has severe
performance penalties as opposed to using `__proto__` and
`Object.setPrototypeOf`. I do not know if there are plans to actually make
`Object.create` a viable choice when it comes to doing so, but until this
serious performance penalty is fixed, I'd like to request the modification of
related warning notices on the MDN docs.

I have yet to run the tests mentioned in the first comment of the gist repo
using JSshell, so I cannot comment on the performance in a SpiderMonkey
environment, but we have to take into consideration that MDN is the definitive
source for Javascript documentation and Node.js/V8 makes up the majority of JS
engine used today.

[1]: https://gist.github.com/friendlyanon/17b680e8352a5eb6faa01c910f4c662e
We did add some information about object creation methods recently:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Inheritance_and_the_prototype_chain#Different_ways_to_create_objects_and_the_resulting_prototype_chain

But you are right that we should probably make the performance warnings clearer. 

Where else have you seen content that needs updating?
Priority: -- → P2
Component: MDN Meta Docs → JavaScript

Closing; this is now tracked at https://github.com/mdn/sprints/issues/993

Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.