SlideShare une entreprise Scribd logo
1  sur  66
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!

Contenu connexe

Similaire à Js compilation falsy values slides

Sun jdk 1.6内存管理 -实现篇 -毕玄
Sun jdk 1.6内存管理 -实现篇 -毕玄Sun jdk 1.6内存管理 -实现篇 -毕玄
Sun jdk 1.6内存管理 -实现篇 -毕玄
锐 张
 
Awd3 m1 desi
Awd3 m1 desiAwd3 m1 desi
Awd3 m1 desi
Senistr0
 
[2018 台灣人工智慧學校校友年會] 產業經驗分享: 如何用最少的訓練樣本,得到最好的深度學習影像分析結果,減少一半人力,提升一倍品質 / 李明達
[2018 台灣人工智慧學校校友年會] 產業經驗分享: 如何用最少的訓練樣本,得到最好的深度學習影像分析結果,減少一半人力,提升一倍品質 / 李明達[2018 台灣人工智慧學校校友年會] 產業經驗分享: 如何用最少的訓練樣本,得到最好的深度學習影像分析結果,減少一半人力,提升一倍品質 / 李明達
[2018 台灣人工智慧學校校友年會] 產業經驗分享: 如何用最少的訓練樣本,得到最好的深度學習影像分析結果,減少一半人力,提升一倍品質 / 李明達
台灣資料科學年會
 

Similaire à Js compilation falsy values slides (12)

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

Dernier

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Dernier (20)

MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

Js compilation falsy values slides

Notes de l'éditeur

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. - heaps cost memory\n - compilation takes time\n
  54. - method - well known, tested\n - tracing - very new, Mozilla, LuaJIT and PyPy the first ones to try it out\n
  55. - fine tuning, compilation vs. time, compression vs. memory etc.\n
  56. - small functions\n - reduce branching\n - keep var types (int vs. float!)\n
  57. \n
  58. \n
  59. \n
  60. \n