|
@v8js | |||||
|
Want to learn something about V8 internals? @camillobruni explains how V8 stores and optimizes properties: v8project.blogspot.com/2017/08/fast-p…
|
||||||
|
||||||
|
Andre Hamman
@Hamman_Andre
|
31. kol 2017. |
|
@WalterEllisFun Pretty cool
|
||
|
|
||
|
Alex
@js636f
|
4. ruj 2017. |
|
Thanks for the great article! I think I found a typo here (or, perhaps, I just don't get something).
|
||
|
|
||
|
Camillo Bruni
@camillobruni
|
7. ruj 2017. |
|
Hi Alex. Can you give more details?
|
||
|
|
||
|
Alex
@js636f
|
4. ruj 2017. |
|
sparseArray[1 << 20] = "foo"; will give us an array with 1048577 elements. Perhaps it should be sparceArray[9999] = "foo"
|
||
|
|
||
|
Camillo Bruni
@camillobruni
|
7. ruj 2017. |
|
1 << 20 creates a very large index. The length is 1048577 but v8 doesn't allocate a full array of this size and uses a dict instead.
|
||
|
|
||
|
Alex
@js636f
|
4. ruj 2017. |
|
An another possible typo is: The key in this case would be 9999 and the value "foo" instead of The key in this case would be 10000 and...
|
||
|
|
||
|
Camillo Bruni
@camillobruni
|
7. ruj 2017. |
|
Ah right :) thanks. I'll update the text accordingly.
|
||
|
|
||