タグ

2022年6月23日のブックマーク (2件)

  • Elements kinds in V8 · V8

    Show navigation Note: If you prefer watching a presentation over reading articles, then enjoy the video below! JavaScript objects can have arbitrary properties associated with them. The names of object properties can contain any character. One of the interesting cases that a JavaScript engine can choose to optimize for are properties whose names are purely numeric, most specifically array indices.

    yuya_presto
    yuya_presto 2022/06/23
    ArrayにPACKEDとHOLEY、SMall IntegersとDoublesとどちらでもない、の2x3=6象限があるという話。一度でも高速な方から落ちるような代入操作が行われると、そのArrayは多少遅い版になったまま戻らない。lengthを超えたreadもダメ。
  • [V8 Deep Dives] Understanding Array Internals

    Photo by Antonio Garcia on UnsplashIn the previous part of this series, we were discussing Map and Set, standard collections introduced in ES6. This time we will focus on JavaScript arrays. Arrays, which are essentially list-like objects, are one of the core features of the language and every JavaScript developer has a solid experience in working with them. This blog post does not try to give you

    [V8 Deep Dives] Understanding Array Internals
    yuya_presto
    yuya_presto 2022/06/23
    V8ではArrayがあるサイズより大きくなると、packedでもholeyでもないただのオブジェクト扱いになるらしい。ちなみにtompngさんいわく、でかい空の配列でfor ofすると、holeyは遅く、ただのオブジェクトは瞬殺だったとか。