SlideShare a Scribd company logo
JS compilation
    hot or not?




                  Zbigniew Braniecki (gandalf@mozilla.com)
let’s talk about benchmarks
5 categories of benchmarks
5 categories of benchmarks
•   Real applications
5 categories of benchmarks
•   Real applications
•   Modified applications
    (eg. with I/O removed to make it CPU-bound)
5 categories of benchmarks
•   Real applications
•   Modified applications
    (eg. with I/O removed to make it CPU-bound)

•   Kernels
    (key fragments of real applications)
5 categories of benchmarks
•   Real applications
•   Modified applications
    (eg. with I/O removed to make it CPU-bound)

•   Kernels
    (key fragments of real applications)

•   Toy benchmarks
    (eg. sieve of Erastosthenes)
5 categories of benchmarks
•   Real applications
•   Modified applications
    (eg. with I/O removed to make it CPU-bound)

•   Kernels
    (key fragments of real applications)

•   Toy benchmarks
    (eg. sieve of Erastosthenes)

•   Synthetic benchmarks
    (code created artificially to fit a profile of particular operations, e.g Dhrystone)
statistics
statistics

•   How common is average?
statistics

•   How common is average?

•   Biases (sampling, memory etc.)
statistics

•   How common is average?

•   Biases (sampling, memory etc.)

•   Measuring the right thing is hard
statistics

•   How common is average?

•   Biases (sampling, memory etc.)

•   Measuring the right thing is hard

•   Reducing complexity
History


How did browser JS performance improve over time
V8
V8

5000


3750


2500


1250


   0
       1.0   1.5   2.0   3.0    3.5   3.6   4   Nightly-JS
V8

5000


3750


2500


1250


   0
       1.0   1.5   2.0   3.0    3.5   3.6   4   Nightly-JS
V8

5000


3750


2500


1250


   0
       1.0   1.5   2.0   3.0    3.5   3.6   4   Nightly-JS
V8

5000


3750


2500


1250


   0
       1.0   1.5   2.0   3.0    3.5   3.6   4   Nightly-JS
V8

5000


3750


2500


1250


   0
       1.0   1.5   2.0   3.0    3.5   3.6   4   Nightly-JS
V8

5000


3750


2500


1250


   0
       1.0   1.5   2.0   3.0    3.5   3.6   4   Nightly-JS
V8

5000


3750


2500


1250


   0
       1.0   1.5   2.0   3.0    3.5   3.6   4   Nightly-JS
V8

5000


3750


2500


1250


   0
       1.0   1.5   2.0   3.0    3.5   3.6   4   Nightly-JS
V8

5000


3750


2500


1250


   0
       1.0   1.5   2.0   3.0    3.5   3.6   4   Nightly-JS
SunSpider
SunSpider

20000


15000


10000


 5000


    0
        1.0   1.5   2.0   3.0   3.5   3.6   4   Nightly-JS
SunSpider

20000


15000


10000


 5000


    0
        1.0   1.5   2.0   3.0   3.5   3.6   4   Nightly-JS
SunSpider

20000


15000


10000


 5000


    0
        1.0   1.5   2.0   3.0   3.5   3.6   4   Nightly-JS
SunSpider

20000


15000


10000


 5000


    0
        1.0   1.5   2.0   3.0   3.5   3.6   4   Nightly-JS
SunSpider

20000


15000


10000


 5000


    0
        1.0   1.5   2.0   3.0   3.5   3.6   4   Nightly-JS
SunSpider

20000


15000


10000


 5000


    0
        1.0   1.5   2.0   3.0   3.5   3.6   4   Nightly-JS
SunSpider

20000


15000


10000


 5000


    0
        1.0   1.5   2.0   3.0   3.5   3.6   4   Nightly-JS
SunSpider

20000


15000


10000


 5000


    0
        1.0   1.5   2.0   3.0   3.5   3.6   4   Nightly-JS
SunSpider

20000


15000


10000


 5000


    0
        1.0   1.5   2.0   3.0   3.5   3.6   4   Nightly-JS
SunSpider
SunSpider

3000


2250


1500


 750


   0
       3.0   3.5      3.6   4.0   Nightly-JS
SunSpider

3000


2250


1500


 750


   0
       3.0   3.5      3.6   4.0   Nightly-JS
SunSpider

3000


2250


1500


 750


   0
       3.0   3.5      3.6   4.0   Nightly-JS
SunSpider

3000


2250


1500


 750


   0
       3.0   3.5      3.6   4.0   Nightly-JS
SunSpider

3000


2250


1500


 750


   0
       3.0   3.5      3.6   4.0   Nightly-JS
SunSpider

3000


2250


1500


 750


   0
       3.0   3.5      3.6   4.0   Nightly-JS
Kraken
Kraken

50000


37500


25000


12500


    0
        3.0   3.5     3.6   4.0   Nightly-JS
Kraken

50000


37500


25000


12500


    0
        3.0   3.5     3.6   4.0   Nightly-JS
Kraken

50000


37500


25000


12500


    0
        3.0   3.5     3.6   4.0   Nightly-JS
Kraken

50000


37500


25000


12500


    0
        3.0   3.5     3.6   4.0   Nightly-JS
Kraken

50000


37500


25000


12500


    0
        3.0   3.5     3.6   4.0   Nightly-JS
Kraken

50000


37500


25000


12500


    0
        3.0   3.5     3.6   4.0   Nightly-JS
Types of JIT


method    vs.       tracing
method JIT
                 heap

     10
      9
      8
      7
      6
      5
      4
      3
      2
      1
      0
             a          b
method JIT
                 heap

     10
      9
      8
      7
      6
      5
      4
      3
      2
      1
      0
             a          b
method JIT
                 heap

     10
      9
      8
      7
      6
      5
      4
      3
      2
      1
      0
             a          b
method JIT
                 heap

     10
      9
      8
      7
      6
      5
      4
      3
      2
      1
      0
             a          b
method JIT
                 heap

     10
      9
      8
      7
      6
      5
      4
      3
      2
      1
      0
             a          b
method JIT
                 heap

     10
      9
      8
      7
      6
      5
      4
      3
      2
      1
      0
             a          b
method JIT
                     heap
hot loop!
            10
             9
             8
             7
             6
             5
             4
             3
             2
             1
             0
                 a          b
tracing JIT
              heap
  a
      10
       9
       8
       7
       6
       5
       4
       3
       2
       1
       0
                a
tracing JIT
                  heap
  b
      10
       9
       8
       7
       6
       5
       4
       3
       2
       1
       0
              a          b
tracing JIT
                      heap
         b
             10
              9
              8
              7
              6
              5
              4
              3
              2
              1
              0
hot trace!        a          b
How browsers compile stuff

•   Chakra (IE) - method

•   Carakan (Opera) - method

•   Nitro (Safari) - method

•   V8 (Chrome) - method

•   JägerMonkey (Firefox) - trace + method
method vs. tracing
How to help JIT
  hot loop!                b




                  hot trace!
What to avoid

•   competing heaps

•   variable type changing

•   evals

•   looong methods
Future

•   Dead code elimination

•   Type Interface

•   Function inlining

•   CrankShaft (Chrome) and IonMonkey (Firefox)
Questions?
Thank You!

More Related Content

KEY
20100707 tanabata trac
PPTX
SLA KWM Technology Presentation
PPTX
Web tools to make you look cool 2012
KEY
Mozilla - Poetry & Pragmatics (Eliberatica09)
KEY
Mozilla Labs - Explore the ideas
PPT
Advising Upgrade Presentation
PPT
What Does The Future Look Like
KEY
Ignite warsaw
20100707 tanabata trac
SLA KWM Technology Presentation
Web tools to make you look cool 2012
Mozilla - Poetry & Pragmatics (Eliberatica09)
Mozilla Labs - Explore the ideas
Advising Upgrade Presentation
What Does The Future Look Like
Ignite warsaw

Similar to Js compilation falsy values slides (9)

PDF
Sun jdk 1.6内存管理 -实现篇 -毕玄
PDF
Blind elephant black hat 2010 v2
PDF
Casino Revenue Potential Study Model By Ramachandar Siva
PDF
Scope of six sigma in indian foundry operations
PDF
Awd3 m1 desi
PDF
JKSimMet Course - Part 1
PPTX
working capital manegment
PDF
Physics Class 9th Chapter 1
PDF
[2018 台灣人工智慧學校校友年會] 產業經驗分享: 如何用最少的訓練樣本,得到最好的深度學習影像分析結果,減少一半人力,提升一倍品質 / 李明達
Sun jdk 1.6内存管理 -实现篇 -毕玄
Blind elephant black hat 2010 v2
Casino Revenue Potential Study Model By Ramachandar Siva
Scope of six sigma in indian foundry operations
Awd3 m1 desi
JKSimMet Course - Part 1
working capital manegment
Physics Class 9th Chapter 1
[2018 台灣人工智慧學校校友年會] 產業經驗分享: 如何用最少的訓練樣本,得到最好的深度學習影像分析結果,減少一半人力,提升一倍品質 / 李明達
Ad

Recently uploaded (20)

PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
cuic standard and advanced reporting.pdf
PDF
Getting Started with Data Integration: FME Form 101
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
Tartificialntelligence_presentation.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
Spectroscopy.pptx food analysis technology
PDF
Approach and Philosophy of On baking technology
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Big Data Technologies - Introduction.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Spectral efficient network and resource selection model in 5G networks
Assigned Numbers - 2025 - Bluetooth® Document
cuic standard and advanced reporting.pdf
Getting Started with Data Integration: FME Form 101
MIND Revenue Release Quarter 2 2025 Press Release
Tartificialntelligence_presentation.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Building Integrated photovoltaic BIPV_UPV.pdf
Spectroscopy.pptx food analysis technology
Approach and Philosophy of On baking technology
The Rise and Fall of 3GPP – Time for a Sabbatical?
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Network Security Unit 5.pdf for BCA BBA.
Big Data Technologies - Introduction.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
A comparative analysis of optical character recognition models for extracting...
Encapsulation_ Review paper, used for researhc scholars
Spectral efficient network and resource selection model in 5G networks
Ad

Js compilation falsy values slides

Editor's Notes