タグ

ブックマーク / mrale.ph (14)

  • Dart VM

    Warning This document is work in progress. Please contact Vyacheslav Egorov (by mail or @mraleph) if you have any questions, suggestions, bug reports. Last update: Oct 6 2022 This document is intended as a reference for new members of the Dart VM team, potential external contributors or just anybody interested in VM internals. It starts with a high-level overview of the Dart VM and then proceeds t

    efcl
    efcl 2019/01/08
    Dart VMがどのように動いているかの紹介記事。 JIT、IC、デバッグオプション、スナップショット、
  • 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版でのボトルネックを調べ改善していく話。 アルゴリズムの改善、言語に依存する問題、実装に依存する問題に
  • Crankshaft vs arguments object

    This is a note in reply to Victor Felder’s question who asked me what “Unsupported phi use of arguments” Crankshaft bailout means. What Crankshaft is trying to do is to completely avoid allocating arguments object when you write the code like this: function foo() { var sum = 0; for (var i = 0; i < arguments.length /* (1) */; i++) { sum += arguments[i]; /* (2) */ } } If one compiles this code naive

    efcl
    efcl 2015/12/06
    V8での`arguments`の最適化について。 applyとargumentsの最適化
  • new Fn(...) vs. Object.create(P)

    This is a note in reply to Kyle Simpson’s question Basics of object layout in V8 Each JavaScript object in V8 looks like this +-------+ | *---+-> hidden class (aka map) +-------+ | *---+-> out-of-object properties storage +-------+ | *---+-> elements storage +-------+ | 1 +-+ +-------+ | | 2 | | +-------+ > N slots reserved for in-object properties ~~~~~~~~~ | +-------+ | | N +-+ +-------+ There a

    efcl
    efcl 2015/12/06
    new FunctionとObject.create
  • Do not Measure the Weather

    Java VM V8 Dart VM complexity ChaCha20 function getBlock(buffer) { var x = new Uint32Array(16); for (var i = 16; i--;) x[i] = input[i]; for (var i = 20; i > 0; i -= 2) { quarterRound(x, 0, 4, 8,12); quarterRound(x, 1, 5, 9,13); quarterRound(x, 2, 6,10,14); quarterRound(x, 3, 7,11,15); quarterRound(x, 0, 5,10,15); quarterRound(x, 1, 6,11,12); quarterRound(x, 2, 7, 8,13); quarterRound(x, 3, 4, 9,14)

    efcl
    efcl 2015/05/17
    jsperfなどでパフォーマンス計測するときの原則 1. verify results 2. no constants 3. no loop invariants 4. no dead code
  • Browser as an Interactive Disassembler

    [The title of this post is intentionally a bit misleading - it should be Browser as an Interactive Disassembly Exploration Tool but that’s way too confusing] Due to the nature of my work I often have to dig through disassembly listings. Usually these are spat out by a compiler I’m working or worked on, which makes it easy to recognize familiar patterns and reconstruct the flow of the program. Asse

    efcl
    efcl 2015/04/04
    IRHydraでアセンブリを見る話
  • IRHydra2

    IRHydra2 is deprecated. Supporting various V8 related features in IRHydra was always a race against the clock. V8 5.9 has switched to a new execution pipeline (TurboFan+Ignition) and modernizing IRHydra to properly work with it would be too much of a time investment for me, given that I don't need to dig into JavaScript performance anymore. Ultimately IRHydra was always just a stopgap solution I c

    efcl
    efcl 2014/09/14
    Dart VM/Chrome/V8のデバッグオプションで吐いたIR等を元に最適化がされていない(de-opt)な部分を可視化したり、ディスアセンブリ(コードと並べて表示も出来る)、コントールフローの表示等をしてくれるツール http://mrale.ph/blog/201
  • The Black Cat of Microbenchmarks

    Sometimes when I search for “jsperf” on Twitter and click through to see some test cases I immediately remember a saying usually attributed to Confucius: “The hardest thing of all is to find a black cat in a dark room, especially if there is no cat.” I like to imagine him rephrasing this saying if Confucius were into JavaScript microbenchmarking himself: “The hardest thing of all is to find which

    efcl
    efcl 2014/09/13
    (jsperf)ベンチマークが求めてるベンチがとれているのか。 Chrome(V8)の起動オプションで最適化のログを吐いてIRHydra2で追っていく話。 Dead code elimination (DCE)によってループ内が消えているケース
  • JIT compilation - TechTalksNSU - March 2014

    V8 & DartVM Вячеслав Егоров @mraleph, [email protected] Tech Talks NSU, March 2014 V8 - JS VM внутри Chrome и node.js Dart - новый язык для вебпрограммирования VM - это просто Быстрая VM - сложнее В чем проблема? // Adding integers. function add(a, b) { return a + b; } // Adding doubles. function add(a, b) { return a + b; } // Concatenating strings. function add(a, b) { return a + b; } // Arrays a

    efcl
    efcl 2014/09/13
    V8とDart VMの最適化についてのスライド。 Hidden Class、Inline Cacheについて詳しく書かれてる。DartとV8のICの違い。 D3.jsでprototypeの図が動いて面白い。
  • V8 Resources

    Practical / optimization Talks Articles General Talks Other Fundamentals Talks Articles Miscellaneous Practical / optimization Talks Understanding V8 (me, nodecamp.eu 2011) [slides] V8 Performance Tuning Tricks (+Daniel Clifford, GDD2011 Berlin) [slides] Console to Chrome (+Lilli Thompson, GDC 2012) [slides] [video] Breaking the JavaScript Speed Barrier with V8 (+Daniel Clifford, Google I/O 2012)

    efcl
    efcl 2014/04/21
    V8に関係するスライドや記事等のリソースまとめ
  • Why asm.js bothers me

    Please note that this post expresses my personal opinion and mine alone, not those of my employer or my teammates. I am writing it because I can’t hold my opinion inside anymore. My head was starting to feel like a balloon that is going to burst any minute. I am writing my thoughts and feelings down to free myself from this pressure. When reading my ramblings below please keep in mind that I used

    efcl
    efcl 2013/03/30
    バイトコードとasm.js
  • Release the IRHydra!

    Compilers are not magical beasts. They are steampunk machines grinding your perfectly structured source into incomprehensible mess of native code. The better the compiler - the finer the grind and stronger our performance espresso. What’s not to like? When however something clogs compiler’s pipes, we find ourselves staring at square meters of intermediate representation printouts and deoptimizatio

    efcl
    efcl 2013/02/22
    Node/V8が吐くIR(code.asm)を見るためのビューアー. 参照先やdeoptimizations、ヘルプ、Disassembly、フローのグラフを見られる
  • microbenchmarks fairy tale

    Imagine for a moment that you are a modern day hero. A prince or a princess adept in JavaScript programming traveling through enchanted world and searching for the World’s Salvation, the Ultimate Love or the well guarded recipe of Siberian dumplings. Sooner or later you encounter a merciless Sphinx who asks you the simplest question you’ve ever heard in your life: “What is the cost of accessing th

    efcl
    efcl 2012/12/23
    V8のコードループ内での.lengthへのアクセスはどう最適化されているのかについて。 ループ不変コードのLICM(loop-invariant code motion)とJITコンパイラについて
  • Grokking V8 closures for fun (and profit?)

    I was thinking about writing a smallish blog post summarizing my thoughts on closure variables vs. instance field performance as a reply to Marijn Haverbeke’s post which postulates initial mystery when I realized that this is an ideal candidate for a longer post that illustrates how V8 handles closures and how these design decisions affect performance. Contexts If you program JavaScript you probab

    efcl
    efcl 2012/09/30
    V8とクロージャーのメモリ保持について。 V8 compilersの吐くmachine codeを見て行く
  • 1