Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Optimizing Ruby with JIT

Optimizing Ruby with JIT

Avatar for Takashi Kokubun

Takashi Kokubun

August 30, 2019
Tweet

More Decks by Takashi Kokubun

Other Decks in Programming

Transcript

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

    (ObjectSpace) • Φʔόʔϑϩʔ͢Δͱܕ͕มΘΔ੔਺ • ΞυϨεมΘΓ์୊ͷώʔϓྖҬ (GC.compact)
  2. 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
  3. 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
  4. 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
  5. 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
  6. 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
  7. ͜ͷ͕ࠩग़Δཧ༝Λݟ͍͖ͯ·͢ 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
  8. 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໋ྩΠϯϥΠϯԽͳ͠)
  9. 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໋ྩΠϯϥΠϯԽͳ͠)
  10. ίϯύΠϥͷ࠷దԽʹΑΔߴ଎Խ 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໋ྩΠϯϥΠϯԽ͋Γ)
  11. ϓϩάϥϜΧ΢ϯλͷ࠷దԽ 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
  12. ελοΫϙΠϯλͷ࠷దԽ 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
  13. ·͔ͩͳΓ͕ࠩ͋Δ 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
  14. ϝιουΠϯϥΠϯԽ 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
  15. Πϯελϯεม਺ͷ࠷దԽ 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