Optimizing Ruby with JIT

Optimizing Ruby with JIT

08d5432a5bc31e6d9edec87b94cb1db1?s=128

Takashi Kokubun

August 30, 2019
Tweet

Transcript

  1. 2.
  2. 5.
  3. 15.

    3. ଞʹ΋ָ͍͠ػೳ͕͍ͬͺ͍ • eval • ଋറ΍؀ڥͷΦϒδΣΫτԽ (binding, Proc) • ೚ҙΦϒδΣΫτͷྻڍػೳ

    (ObjectSpace) • Φʔόʔϑϩʔ͢Δͱܕ͕มΘΔ੔਺ • ΞυϨεมΘΓ์୊ͷώʔϓྖҬ (GC.compact)
  4. 34.

    JITʹ͓͚Δੑೳ޲্ NES emulator: github.com/mame/optcarrot fps 0 23 46 69 92

    2.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 34.2 Details: https://gist.github.com/k0kubun/0337e1f40b146b2cae7b7c8e6a79973a 1.0x Version
  5. 35.

    JITʹ͓͚Δੑೳ޲্ NES emulator: github.com/mame/optcarrot fps 0 23 46 69 92

    2.0 2.1 2.2 2.3 0.0 0.0 0.0 0.0 39.1 37.9 37.8 34.2 Details: https://gist.github.com/k0kubun/0337e1f40b146b2cae7b7c8e6a79973a 1.1x Version
  6. 36.

    JITʹ͓͚Δੑೳ޲্ NES emulator: github.com/mame/optcarrot fps 0 23 46 69 92

    2.0 2.1 2.2 2.3 2.4 2.5 0.0 0.0 49.0 46.2 39.1 37.9 37.8 34.2 Details: https://gist.github.com/k0kubun/0337e1f40b146b2cae7b7c8e6a79973a 1.4x Version
  7. 37.

    JITʹ͓͚Δੑೳ޲্ NES emulator: github.com/mame/optcarrot fps 0 23 46 69 92

    2.0 2.1 2.2 2.3 2.4 2.5 2.6 0.0 55.9 49.0 46.2 39.1 37.9 37.8 34.2 Details: https://gist.github.com/k0kubun/0337e1f40b146b2cae7b7c8e6a79973a 1.6x Version
  8. 38.

    JITʹ͓͚Δੑೳ޲্ NES emulator: github.com/mame/optcarrot fps 0 23 46 69 92

    2.0 2.1 2.2 2.3 2.4 2.5 2.6 2.6 JIT 85.8 55.9 49.0 46.2 39.1 37.9 37.8 34.2 Details: https://gist.github.com/k0kubun/0337e1f40b146b2cae7b7c8e6a79973a 2.5x Version
  9. 39.

    ͜ͷ͕ࠩग़Δཧ༝Λݟ͍͖ͯ·͢ NES emulator: github.com/mame/optcarrot fps 0 23 46 69 92

    2.6 2.6 JIT 85.8 55.9 0.0 0.0 0.0 0.0 0.0 0.0 Details: https://gist.github.com/k0kubun/0337e1f40b146b2cae7b7c8e6a79973a Version
  10. 42.

    VM࣮ߦ → ػցޠ ͰͷੑೳมԽ NES emulator: github.com/mame/optcarrot fps 0 23

    46 69 92 2.6 native 2.6 JIT 85.8 55.9 ? (-O3 w/ VM໋ྩΠϯϥΠϯԽͳ͠)
  11. 43.

    VM࣮ߦ → ػցޠ ͰͷੑೳมԽ NES emulator: github.com/mame/optcarrot fps 0 23

    46 69 92 2.6 native 2.6 JIT 85.8 56.2 55.9 (-O3 w/ VM໋ྩΠϯϥΠϯԽͳ͠)
  12. 46.
  13. 47.
  14. 48.
  15. 49.
  16. 50.
  17. 51.
  18. 52.
  19. 53.
  20. 54.
  21. 55.
  22. 56.
  23. 57.
  24. 58.
  25. 59.
  26. 60.
  27. 61.
  28. 62.
  29. 65.

    ίϯύΠϥͷ࠷దԽʹΑΔߴ଎Խ NES emulator: github.com/mame/optcarrot fps 0 23 46 69 92

    2.6 native com piler 2.6 JIT 85.8 62.5 56.2 55.9 (-O3 w/ VM໋ྩΠϯϥΠϯԽ͋Γ)
  30. 67.
  31. 70.
  32. 71.
  33. 72.

    ϓϩάϥϜΧ΢ϯλͷ࠷దԽ NES emulator: github.com/mame/optcarrot fps 0 23 46 69 92

    2.6 native com piler pc 2.6 JIT 85.8 62.7 62.5 56.2 55.9
  34. 74.
  35. 77.
  36. 78.
  37. 79.
  38. 80.
  39. 81.

    ελοΫϙΠϯλͷ࠷దԽ NES emulator: github.com/mame/optcarrot fps 0 23 46 69 92

    2.6 native com piler pc sp 2.6 JIT 85.8 66.4 62.7 62.5 56.2 55.9
  40. 82.

    ·͔ͩͳΓ͕ࠩ͋Δ NES emulator: github.com/mame/optcarrot fps 0 23 46 69 92

    2.6 native com piler pc sp 2.6 JIT 85.8 66.4 62.7 62.5 56.2 55.9
  41. 86.
  42. 92.
  43. 93.
  44. 94.

    ϝιουΠϯϥΠϯԽ NES emulator: github.com/mame/optcarrot fps 0 23 46 69 92

    2.6 native com piler pc sp inline 2.6 JIT 85.8 72.4 66.4 62.7 62.5 56.2 55.9
  45. 100.

    Πϯελϯεม਺ͷ࠷దԽ NES emulator: github.com/mame/optcarrot fps 0 23 46 69 92

    2.6 native com piler pc sp inline ivar 2.6 JIT 85.8 85.8 72.4 66.4 62.7 62.5 56.2 55.9