Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Js compilation falsy values slides

2,692 views

Published on

How does JS engine compete in performance space, how they compile, what are different compilation techniques and what will come in the future

Published in: Technology
  • one mistake here, in slide 56 instead of 'hot loop!' it should be 'hot method!'
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Js compilation falsy values slides

  1. 1. JS compilation hot or not? Zbigniew Braniecki (gandalf@mozilla.com)
  2. 2. let’s talk about benchmarks
  3. 3. 5 categories of benchmarks
  4. 4. 5 categories of benchmarks• Real applications
  5. 5. 5 categories of benchmarks• Real applications• Modified applications (eg. with I/O removed to make it CPU-bound)
  6. 6. 5 categories of benchmarks• Real applications• Modified applications (eg. with I/O removed to make it CPU-bound)• Kernels (key fragments of real applications)
  7. 7. 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)
  8. 8. 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)
  9. 9. statistics
  10. 10. statistics• How common is average?
  11. 11. statistics• How common is average?• Biases (sampling, memory etc.)
  12. 12. statistics• How common is average?• Biases (sampling, memory etc.)• Measuring the right thing is hard
  13. 13. statistics• How common is average?• Biases (sampling, memory etc.)• Measuring the right thing is hard• Reducing complexity
  14. 14. HistoryHow did browser JS performance improve over time
  15. 15. V8
  16. 16. V85000375025001250 0 1.0 1.5 2.0 3.0 3.5 3.6 4 Nightly-JS
  17. 17. V85000375025001250 0 1.0 1.5 2.0 3.0 3.5 3.6 4 Nightly-JS
  18. 18. V85000375025001250 0 1.0 1.5 2.0 3.0 3.5 3.6 4 Nightly-JS
  19. 19. V85000375025001250 0 1.0 1.5 2.0 3.0 3.5 3.6 4 Nightly-JS
  20. 20. V85000375025001250 0 1.0 1.5 2.0 3.0 3.5 3.6 4 Nightly-JS
  21. 21. V85000375025001250 0 1.0 1.5 2.0 3.0 3.5 3.6 4 Nightly-JS
  22. 22. V85000375025001250 0 1.0 1.5 2.0 3.0 3.5 3.6 4 Nightly-JS
  23. 23. V85000375025001250 0 1.0 1.5 2.0 3.0 3.5 3.6 4 Nightly-JS
  24. 24. V85000375025001250 0 1.0 1.5 2.0 3.0 3.5 3.6 4 Nightly-JS
  25. 25. SunSpider
  26. 26. SunSpider200001500010000 5000 0 1.0 1.5 2.0 3.0 3.5 3.6 4 Nightly-JS
  27. 27. SunSpider200001500010000 5000 0 1.0 1.5 2.0 3.0 3.5 3.6 4 Nightly-JS
  28. 28. SunSpider200001500010000 5000 0 1.0 1.5 2.0 3.0 3.5 3.6 4 Nightly-JS
  29. 29. SunSpider200001500010000 5000 0 1.0 1.5 2.0 3.0 3.5 3.6 4 Nightly-JS
  30. 30. SunSpider200001500010000 5000 0 1.0 1.5 2.0 3.0 3.5 3.6 4 Nightly-JS
  31. 31. SunSpider200001500010000 5000 0 1.0 1.5 2.0 3.0 3.5 3.6 4 Nightly-JS
  32. 32. SunSpider200001500010000 5000 0 1.0 1.5 2.0 3.0 3.5 3.6 4 Nightly-JS
  33. 33. SunSpider200001500010000 5000 0 1.0 1.5 2.0 3.0 3.5 3.6 4 Nightly-JS
  34. 34. SunSpider200001500010000 5000 0 1.0 1.5 2.0 3.0 3.5 3.6 4 Nightly-JS
  35. 35. SunSpider
  36. 36. SunSpider300022501500 750 0 3.0 3.5 3.6 4.0 Nightly-JS
  37. 37. SunSpider300022501500 750 0 3.0 3.5 3.6 4.0 Nightly-JS
  38. 38. SunSpider300022501500 750 0 3.0 3.5 3.6 4.0 Nightly-JS
  39. 39. SunSpider300022501500 750 0 3.0 3.5 3.6 4.0 Nightly-JS
  40. 40. SunSpider300022501500 750 0 3.0 3.5 3.6 4.0 Nightly-JS
  41. 41. SunSpider300022501500 750 0 3.0 3.5 3.6 4.0 Nightly-JS
  42. 42. Kraken
  43. 43. Kraken50000375002500012500 0 3.0 3.5 3.6 4.0 Nightly-JS
  44. 44. Kraken50000375002500012500 0 3.0 3.5 3.6 4.0 Nightly-JS
  45. 45. Kraken50000375002500012500 0 3.0 3.5 3.6 4.0 Nightly-JS
  46. 46. Kraken50000375002500012500 0 3.0 3.5 3.6 4.0 Nightly-JS
  47. 47. Kraken50000375002500012500 0 3.0 3.5 3.6 4.0 Nightly-JS
  48. 48. Kraken50000375002500012500 0 3.0 3.5 3.6 4.0 Nightly-JS
  49. 49. Types of JITmethod vs. tracing
  50. 50. method JIT heap 10 9 8 7 6 5 4 3 2 1 0 a b
  51. 51. method JIT heap 10 9 8 7 6 5 4 3 2 1 0 a b
  52. 52. method JIT heap 10 9 8 7 6 5 4 3 2 1 0 a b
  53. 53. method JIT heap 10 9 8 7 6 5 4 3 2 1 0 a b
  54. 54. method JIT heap 10 9 8 7 6 5 4 3 2 1 0 a b
  55. 55. method JIT heap 10 9 8 7 6 5 4 3 2 1 0 a b
  56. 56. method JIT heaphot loop! 10 9 8 7 6 5 4 3 2 1 0 a b
  57. 57. tracing JIT heap a 10 9 8 7 6 5 4 3 2 1 0 a
  58. 58. tracing JIT heap b 10 9 8 7 6 5 4 3 2 1 0 a b
  59. 59. tracing JIT heap b 10 9 8 7 6 5 4 3 2 1 0hot trace! a b
  60. 60. How browsers compile stuff• Chakra (IE) - method• Carakan (Opera) - method• Nitro (Safari) - method• V8 (Chrome) - method• JägerMonkey (Firefox) - trace + method
  61. 61. method vs. tracing
  62. 62. How to help JIT hot loop! b hot trace!
  63. 63. What to avoid• competing heaps• variable type changing• evals• looong methods
  64. 64. Future• Dead code elimination• Type Interface• Function inlining• CrankShaft (Chrome) and IonMonkey (Firefox)
  65. 65. Questions?
  66. 66. Thank You!

×