タグ

JavaScriptとarticleとV8に関するefclのブックマーク (7)

  • Land ahoy: leaving the Sea of Nodes · V8

    V8’s end-tier optimizing compiler, Turbofan, is famously one of the few large-scale production compilers to use Sea of Nodes (SoN). However, since almost 3 years ago, we’ve started to get rid of Sea of Nodes and fall back to a more traditional Control-Flow Graph (CFG) Intermediate Representation (IR), which we named Turboshaft. By now, the whole JavaScript backend of Turbofan uses Turboshaft inste

    efcl
    efcl 2025/04/06
    V8がSea of NodesをやめてControl-Flow Graph にした話 "Sea of Nodes: elegant but impractical for JavaScript"
  • Object Structure in JavaScript Engines

    Object Structure in JavaScript EnginesFrom a developer's perspective, objects in JavaScript are quite flexible and understandable. We can add, remove, and modify object properties on our own. However, few people think about how objects are stored in memory and processed by JS engines. Can a developer's actions, directly or indirectly, impact performance and memory consumption? Let's try to delve i

    Object Structure in JavaScript Engines
    efcl
    efcl 2024/04/10
    d8(V8)でのJavaScriptのオブジェクト構造を見ていく話
  • Iterator helpers · V8

    Iterator helpers are a collection of new methods on Iterator prototype that help in general use of iterators. Since these helper methods are on the iterator prototype, any object that has Iterator.prototype on its prototype chain (e.g. array iterators) will get the methods. In the following subsections, we explain iterator helpers. All the provided examples are working in a blog archive page that

    efcl
    efcl 2024/03/31
    Chrome 122でサポートされたES Proposal Stage 3のIterator Helpersについて。 map/filter/take/drop/flatMap/reduce/toArray/forEach/some/every/findなどの使い方について
  • Array.prototype.sort について

    JavaScriptの配列にはsortメソッドがあり配列のソートを実行することができるけど、この配列のソートの中の実装はどうなっているのかという話。v8における配列ソートについての記事が大変参考になりました。 Chrome(V8)の実装はarray.jsにあり、配列の要素数が10以下の場合はInsertion sortを使い、それ以上の場合はQuicksortを利用する。Insersion sortの計算量はO(n^2)であるけど、少ない要素数の場合はQuicksortなどより高速になるらしい。直近のcommmitを見る限りだと、Chrome 69か70あたりでTimsortに置き換えるつもりらしい。TimsortはaverageがO(n log n)で、最悪でもO(n log n)の計算量で済む。QuicksortをTimSortに置き換えるつもりに至った経緯などは調べてない(ので間違っ

    Array.prototype.sort について
    efcl
    efcl 2018/07/30
    各ブラウザのJavaScriptエンジンのsotの実装について。 仕様では安定ソートを保証しないが、大体が安定ソートになっていっている。 V8はV8 7.0/Chrome 70でTimesortになる。
  • Maybe you don't need Rust and WASM to speed up your JS

    Few weeks ago I noticed a blog post “Oxidizing Source Maps with Rust and WebAssembly” making rounds on Twitter - talking about performance benefits of replacing plain JavaScript in the core of source-map library with a Rust version compiled to WebAssembly. This post piqued my interest, not because I am a huge on either Rust or WASM, but rather because I am always curious about language features an

    efcl
    efcl 2018/02/26
    プロファイルを取りパフォーマンスを改善していく話。 Rust + wasmで書き直されたSource Mapライブラリを例に、JS版でのボトルネックを調べ改善していく話。 アルゴリズムの改善、言語に依存する問題、実装に依存する問題に
  • V8: Behind the Scenes (February Edition feat. A tale of TurboFan) · Benedikt Meurer

    Benedikt Meurer JavaScript Engine Hacker and Programming Language Enthusiast. V8: Behind the Scenes (February Edition feat. A tale of TurboFan) 01 Mar 2017 turbofan • v8February has been an exciting and very, very busy month for me. As you have probably heard, we’ve finally announced that we will launch the Ignition+TurboFan pipeline in Chrome 59. So despite running late, and not making it for Feb

    efcl
    efcl 2017/03/06
    ChromeのTurboFanプロジェクトの歴史について。 2013年から開始したプロジェクトで、Crankshaftはfast pathにフォーカスしていたが、TurboFanはslow pathにもフォーカスしているという話。 V8において予測できないパフォーマンス問題を
  • High-performance ES2015 and beyond · V8

    Show navigation Over the last couple of months the V8 team focused on bringing the performance of newly added ES2015 and other even more recent JavaScript features on par with their transpiled ES5 counterparts. Motivation #Before we go into the details of the various improvements, we should first consider why performance of ES2015+ features matter despite the widespread usage of Babel in modern we

    efcl
    efcl 2017/02/18
    V8のES2015+のパフォーマンス改善の取り組みについて。 Babelで変換されたコードサイズの問題やES5で同等の事を行う時の速度の違いについてなど
  • 1