|
|
|
|
|
by senotrusov
3861 days ago
|
|
Trying to understand the described matter I created some simple code to benchmark different cases. Probably I got something wrong, but setting properties inside the constructor function (prop-benchmark-b.js) are almost 6 times slower that setting them outside of it (prop-benchmark-a.js) https://gist.github.com/senotrusov/597514c773089b6989c6 What do you think, why I got such a different numbers? Thank you! |
|
If you fix this bug, e.g. by doing
you actually OOM in prop-benchmark-a.js case because object there is less compact than one created by constructor. Just as the post predicts.