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

JITコンパイラはいかにRailsを速くするか / Rails Developers Meetup 2017

JITコンパイラはいかにRailsを速くするか / Rails Developers Meetup 2017

Rails Developers Meetup 2017 / k0kubun

08d5432a5bc31e6d9edec87b94cb1db1?s=128

Takashi Kokubun

December 09, 2017
Tweet

Transcript

  1. JITίϯύΠϥ͸͍͔ʹ RAILSΛ଎͘͢Δ͔ RAILS DEVELOPERS MEETUP 2017

  2. self #=> • @k0kubun • TreasureDataॴଐ • Rubyίϛολ • Hamlitͷ࡞ऀɺERBͱHamlͷϝϯςφ

    • barbeque, mitamae, xremap΋ΑΖ͘͠
  3. ࠷ۙRubyʹ͍Εͨػೳͷએ఻ (Feature#14124) • binding.pry Έ͍ͨʹ binding.irb ͨ࣌͠ʹपลίʔυ͕දࣔ͞ΕΔΑ͏ʹͳΔ • ͜Ε͕͋ͬͯॳΊͯbinding.irb׬੒ͨ͠ͱݴͬͯ΋աݴͰ͸ͳ͍(?) •

    ଞʹ΋Ruby 2.5Ͱ͸ͳΜͱ require "irb" ͠ͳͯ͘΋ࣗಈͰϩʔυ͞ΕΔΑ͏ʹͳΓɺ binding.irb ͕ศརʹͳΔ
  4. None
  5. ಥવͰ͕͢ɺTDͰಇ͖͍ͨ ํ͍·ͤΜ͔ʁ

  6. օ͞Μ͕ԿނTDʹԠื͠ͳ͍ͷ͔ෆ໌ • ෼ࢄDBΫϥ΢υͷཪଆΛݟΒΕΔɺ։ൃ͕Ͱ͖Δ • ༷ʑͳ෼໺ͷ༏लͳಉ྅ͱҰॹʹ࢓ࣄ͕Ͱ͖Δ • Fluentd, Embulk, Digdag౳OSS։ൃ͕࢓ࣄʹͰ͖Δ •

    γϦίϯόϨʔग़ࢿͷ଴۰ɺۈ຿࣌ؒͷࣗ༝౓΋ߴ͍
  7. RailsͰग़དྷ͍ͯΔίϯϙʔωϯτୡ • ϓϩμΫτ • Treasure Data Service • Customer Data

    Platform • Enterprise Fluentd Management Console • ϚΠΫϩαʔϏε • Embulk config management API
  8. Treasure Data Service ͷνʔϜ • kamipo (ϦϞʔτ) • ϑΣϧφϯυ (US,

    ϦϞʔτ) • uu59 • k0kubun • makimoto
  9. k0kubunͱJIT ͜Ε·Ͱͷ͋Β͢͡

  10. 2017೥4݄: ΋ͬͱ଎͍Rubyཉ͠ ͍ͳ… → JIT͚ͩॻ͚͹Αͦ͞͏

  11. 2017೥4-6݄: C++ͱLLVMΛษڧ͠ͳ͕Βɺ CRuby޲͚ͷελοΫϕʔεͷϝιουJITΛ ։ൃ

  12. 2017೥7݄: ຊମ΁ͷϚʔδΛເݟ ͯCʹॻ͖௚͠ "LLRB" ͱͯ͠ެ։

  13. 2017೥7-8݄: MJIT͕ຊମʹೖΓͦ͏ͩ͠ LLRB͸͍͍͔ͱ͍͏ؾ࣋ͪʹͳΓɺGraphQL Ͱ༡ΜͰ͍ͨ

  14. 2017೥9݄: RubyKaigiͰͷϨδελϕʔεͷϝ ιουJIT "MJIT" ͷൃදޙɺϦεΫΛऔΒͣε λοΫϕʔεͷ··Ͱ଎͍JITΛ࡞Δ͜ͱΛܾҙ

  15. 2017೥10݄: MJITͷ͏ͪJITίʔυੜ੒෦෼͚ͩஔ ͖׵͑ͨ "YARV-MJIT" Λ։ൃɺެ։ (optcarrot: YARV-MJIT/gcc 56.4, MJIT/gcc 75.6)

  16. 2017೥11݄: RubyConfʹ޲͚YARV-MJITߴ଎ ԽɺpthreadҠ২ɺWindowsରԠ (optcarrot: YARV-MJIT/gcc 69.4, MJIT/gcc 75.6)

  17. 2017೥12݄: railsdm2017 ͰJIT͕RailsʹͲΕ͘ Β͍ޮՌ͕͋Δ͔࿩͢༧ఆ͕ͩͬͨɺYARV-MJIT ΛRailsͰಈ͔͠ଓ͚ΔͱյΕΔ͜ͱʹؾ෇͘

  18. 2017೥12݄: RailsͰಈ͘Α͏ʹ͢΂͘Ұࡢ೔͔ ΒYARV-MJITͷج൫ͷॻ͖௚͠Λ࢝Ίɺͦͷϒ ϥϯνͰ͸ΑΓ҆ఆͯ͠ಈ͘Α͏ʹͳͬͨ

  19. ͔͠͠RailsͰಈ͔ͯ͠Δͱ ΍ͬͺ͍͔ͭյΕΔ

  20. ͳͷͰࠓ೔͸͜͏͍͏࿩Λ͠·͢ • CRuby޲͚ͷJITͷݱঢ় • Ͳͷ͘Β͍Rails͕ಈ͔ͤΔͷ͔ • ϕϯνϚʔΫ݁Ռ • YARV-MJIT͕ߦͳ͏࠷దԽͷ࢓૊Έ •

    ͦΕͧΕͷRails΁ͷΠϯύΫτͷ༧૝ • RailsͰͷYARV-MJITͷ࢖͍ํ
  21. CRuby޲͚ͷJITͷݱঢ়

  22. CRuby޲͚ͷJITͨͪ • RuJIT: TraceϕʔεɺϝϞϦ࢖༻ྔ͕໰୊ʹͳͬͨ໛༷ • Eclipse OMR: Optcarrotͩͱ଎͘ͳΒͳ͍Β͍͠ • LLRB:

    LLVMਏ͍ɺͪ͜Β͔Β͸Ҏ্ • MJIT: ଎͍ɺগͳ͍ϝϞϦফඅɺมͳґଘ΋ͳ͍ • YARV-MJIT: ͪΐͬͱMJITΑΓ஗͍͕ɺVMଆ͕όάΒͳ͍
  23. ࠓ೔͸MJIT, YARV-MJITͷ࿩͚ͩ͠·͢ • RuJIT: TraceϕʔεɺϝϞϦ࢖༻ྔ͕໰୊ʹͳͬͨ໛༷ • Eclipse OMR: Optcarrotͩͱ଎͘ͳΒͳ͍Β͍͠ •

    LLRB: LLVMਏ͍ɺͪ͜Β͔Β͸Ҏ্ • MJIT: ଎͍ɺগͳ͍ϝϞϦফඅɺมͳґଘ΋ͳ͍ • YARV-MJIT: ͪΐͬͱMJITΑΓ஗͍͕ɺVMଆ͕όάΒͳ͍
  24. MJITͱ͸ • GitHub: vnmakarov/ruby • CRubyͷͨΊͷϝιουJITίϯύΠϥ • JITίϯύΠϥ͚ͩͰͳ͘ɺϕʔεͷVM໋ྩ΋ஔ͖׵͑ • JIT༻pthread͕gcc΍clangΛfork,

    execͯ͠dlopen, dlsym • ͜ͷͨΊWindowsͰ͸ಈ͔ͳ͍ • http://rubykaigi.org/2017/presentations/vnmakarov.html
  25. YARV-MJITͱ͸ • GitHub: k0kubun/yarv-mjit • MJITΛΑΓอकతʹͨ͠ϑΥʔΫ, trunkʹ௥ैத • JITج൫Λվળͭͭ͠ɺVM໋ྩ͸ஔ͖׵͑ͳ͍ •

    ଎౓͸MJITʹগ͠ྼΔ͕ɺRuby 2.5ΑΓे෼ߴ଎ • pthread෦෼ΛWindows޲͚ʹҠ২ࡁɺMinGWͰ͸׬શʹಈ࡞
  26. ԿނYARV-MJITΛ։ൃ͍ͯ͠Δͷ͔ • RubyΛόάͳ͘ϦϦʔε͍ͯͨ͘͠Ίʹ͸ɺ͍͖ͳΓMJITΛೖΕΔͷ͸೉ͦ͠͏ • VM໋ྩͷஔ͖׵͑͸ϦεΩʔ (YARV͕ೖͬͨRuby 1.9΋࠷ॳ͸͔ͳΓյΕ͍ͯͨ໛༷) • JIT͸ΦϓγϣφϧͳͷͰࢼݧతʹಋೖ͠΍͍͕͢ɺVMͷมߋ͸όάΔͱճආͰ͖ͳ͍ •

    ͦΕͱಉ࣌ʹҠ২ੑΛղܾ͠ͳ͕ΒJITج൫΋ಋೖ͢Δඞཁ͕͋Δ • VMͦͷ··Ͱ΋ಈ͘γϯϓϧͳJIT (YARV-MJIT) ΛͱΓ͋͑ͣೖΕͯΈͨΒͲ͏͔ • ෦෼తʹupstreamʹ͋ΔͱMJIT͕ίϯϑϦΫτ͠ʹ͘͘ͳΓɺڞ༗͍ͯ͠ΔJITج൫΋ڠ ྗͯ͠։ൃ͠΍͘͢ͳΔ
  27. ͰɺRailsͰಈ͘ΜͰ͔͢ʁ

  28. ͦ΋ͦ΋Rubyຊମͷςετ͕ͲͪΒ΋શ෦͸௨Βͳ͍ .+*5 :"37.+*5 NBLFUFTUUFTUBMMTQFD XJUIPVU+*5 ˓ºº ˓˓˓ NBLFUFTUUFTUBMMTQFD XJUI+*5 ˓ºº

    ºº˓
  29. MJIT on Rails • MJIT͕ϕʔεʹ͍ͯ͠ΔRTL໋ྩͷVMͰffi͕ಈ͔ͳ͍ • rubyͷtest-allͱ͔rubyspec΋མͪΔ • ͳͷͰJIT͕༗ޮ͔Ͳ͏͔ʹؔΘΒͣɺݱঢ়Rails͸ىಈෆೳ •

    ͨͩ͠ɺVladimir͸RTLΛYARV→JIT࣌ͷதؒදݱʹมߋதΒ͍͠ͷͰղܾ͞ΕΔ͔ ΋͠Εͳ͍͕ɺະެ։ͷͨΊෆ໌
  30. YARV-MJIT on Rails • VMʹ΄΅ϊʔλονͳͷͰJIT͕ແޮͷঢ়ଶͰ͸RailsͩΖ͏͕׬શʹಈ࡞͢Δ • JIT༗ޮͩͱଟ෼͓͔͍͠ίϯύΠϧΛ͍ͯ͠Δͷ͕͍͔͋ͬͯͭམͪΔ • Ϛʔδ͢Δʹͯ͠΋͜Ε͸ղܾ͔ͯ͠ΒͰ͠ΐ͏Ͷ

  31. ϕϯνϚʔΫ݁Ռ

  32. Ruby 3x3 ͷ֬ೝʹ࢖ΘΕ͍ͯΔϕϯνϚʔΫ • mame/optcarrot • Rubyίϛολͷԕ౻͞Μ࡞ NESΤϛϡϨʔλͷϕϯν • noahgibbs/rails_ruby_bench

    • Noah GibbsʹΑΔ RailsΞϓϦdiscourseΛ࢖ͬͨϕϯν
  33. mame/optcarrot 0QUDBSSPUXJUI-BO@.BTUFS GQT      Ruby 2.0

    Ruby 2.5 YARV-MJIT MJIT    
  34. noahgibbs/rails_ruby_bench • MJIT, YARV-MJIT ͕RailsͰಈ͔͘Ͳ͏͔Ҏલʹ͜ͷϕϯνϚʔΫͷ࣮ߦ͕೉͍͠ • RubyͱRailsͷίϛολʔͷদా͞Μ΋ಈ͔ͤͳ͔ͬͨ͠ɺ๻΋ಈ͔ͤͳ͔ͬͨ • ͳͷͰɺࠓͪΐͬͱࣗ෼ͰRailsͷϕϯνϚʔΫΛॻ͖࢝Ί͍ͯΔ

  35. Ruby Grant 2017ͷϕϯν ϚʔΫϓϩδΣΫτʹ͍ͭͯ

  36. Ruby Grant 2017΍ͬͯ·͢ • Ruby Grant ͱ͸: 50ສԁΛ͍͍ͨͩͯRubyʹߩݙ͢Δౕ • ๻͸ϕϯνϚʔΫ؀ڥͷ੔උΛ΍͍ͬͯ·͢

    • benchmark_driver.gem • ैདྷͷϕϯνϚʔΧʔʹଘࡏ͢ΔProcݺͼग़͠ͷΦʔόʔϔου͕ͳͤ͘Δ • ϝϞϦ࢖༻ྔΛܭଌͨ͠ΓɺΞ΢τϓοτΛϓϥάΠϯͰࣗ༝ʹม͑ͨΓ • ͋ͱͦΕΛ࢖ͬͯϕϯνϚʔΫηοτͷ֦ॆͱɺCI؀ڥΛ༻ҙ͠·͢ • ࠷ऴతʹ͸RubyBench΁ͷ߹ྲྀ΋ࢹ໺
  37. ϕϯνϚʔΫηοτͷ֦ॆʹ͍ͭͯ • RubyͷίΞΫϥεͷϝιουͷΧόϨοδΛ্͍͛ͯ͘ • Railsͱ͔Fluentdͱ͔ͷϕϯνϚʔΫ΋ॻ͜͏ͱࢥ͍ͬͯΔ • Rails΍Γ࢝Ίͨ: https://github.com/benchmark-driver/rails-benchmarks • ActionViewͷϕϯνॻ͍ͯͨͱࢥͬͨΒςϯϓϨʔτΤϯδϯΛϕϯν͍ͯͨ͠

  38. YARV-MJITͷ࠷దԽͷ࢓૊Έ

  39. YARV-MJITͷ࠷దԽͷ࢓૊Έ QVUPCKFDU QVUPCKFDU PQU@NVMU MFBWF $BMMDPVOU :"37CZUFDPEF 5ISFBE3VCZ7. 5ISFBE+*5DPNQJMFS *OUFSQSFU

  40. YARV-MJITͷ࠷దԽͷ࢓૊Έ QVUPCKFDU QVUPCKFDU PQU@NVMU MFBWF $BMMDPVOU 7"-6&PQU@NVMU B C \

    *G OPU@SFEFpOFE JOU@NVMU \ SFUVSOB C ^FMTF\ SFUVSOWN@FYFD  ^ ^ 7"-6&OBUJWF@DPEF \ SFUVSOPQU@NVMU    ^ $DPNQJMFS 0QUJNJ[F$PNQJMF :"37CZUFDPEF 5ISFBE3VCZ7. 5ISFBE+*5DPNQJMFS (FOFSBUF$DPEF *OUFSQSFU
  41. YARV-MJITͷ࠷దԽͷ࢓૊Έ #ZUFDPEF GPS3VCZ7. QVUPCKFDU QVUPCKFDU PQU@NVMU MFBWF $BMMDPVOU 40pMF 7"-6&OBUJWF@DPEF

    \ *G OPU@SFEFpOFE JOU@NVMU \ SFUVSO ^FMTF\ SFUVSOWN@FYFD  ^ ^ $BMM $DPNQJMFS 5ISFBE3VCZ7. 5ISFBE+*5DPNQJMFS *OUFSQSFU (FOFSBUF$DPEF EMTZN /BUJWFDPEF
  42. ͜ͷݩͷੜ੒ίʔυΛݡ͘͠ͳ͍ͱ଎͘ͳΒͳ͍ͷͰɺͦͷ࿩ #ZUFDPEF GPS3VCZ7. QVUPCKFDU QVUPCKFDU PQU@NVMU MFBWF $BMMDPVOU 40pMF 7"-6&OBUJWF@DPEF

    \ *G OPU@SFEFpOFE JOU@NVMU \ SFUVSO ^FMTF\ SFUVSOWN@FYFD  ^ ^ $BMM $DPNQJMFS 5ISFBE3VCZ7. 5ISFBE+*5DPNQJMFS *OUFSQSFU (FOFSBUF$DPEF EMTZN /BUJWFDPEF
  43. JITίʔυͷ࠷దԽઓུ

  44. JITίʔυͷ࠷దԽઓུ • ๻͕RubyKaigi 2017ͷΩʔϊʔτʹٻΊ͍͚ͯͨͲ࿩͞Εͳ͔ͬͨ෦෼ • MJITͱYARV-MJITͷίϯύΠϥ͸ผ෺͕ͩɺ଎͞ͷຊ࣭తͳཧ༝͸ଟ͘ڞ༗͍ͯ͠Δ • MJIT͕଎͍ཧ༝͸ϕʔεͷ໋ྩ͕Ϩδελϕʔε͔ͩΒͰ͸ͳ͍ͱࢥ͍ͬͯΔ • ͜ΕҎ߱ͷ಺༰ͰͦΕΛূ໌

  45. جຊΞΠσΞ • ݱࡏ͸ओʹҎԼͷ3छྨͷ࠷దԽʹϑΥʔΧε: • ؔ਺ͷΠϯϥΠϯԽ • ෆཁॲཧͷলུ • ίϯύΠϧ࣌ؒͷ୹ॖ •

    ͦΕͧΕRailsʹޮՌ͕͋Γͦ͏͔ߟ࡯Λ͍Ε·͢ • ΋͠શ෦ޮՌ͋ΔͳΒɺRailsͷRubyͷϨΠϠʔ͕ಉ͘͡Β͍଎͘ͳΔ͸ͣ
  46. ઓུ1: VMͷίʔυΛͳΔ΂͘ϔομʹؚΊΠϯϥΠϯԽ͢Δ • ର৅: ؔ਺ͷΠϯϥΠϯԽ (MJIT͔ΒͷҠ২) • ίϯύΠϥ͸ίϯύΠϥʹ౉͞Εͨίʔυ͔͠࠷దԽͰ͖ͳ͍ͷͰɺఆٛΛ౉͢ • ୯ʹ

    vm.c ΛϓϦϓϩηεͨ͠΋ͷΛϔομͱͯ͠Πϯετʔϧ • Railsʹޮ͔͘: ◦ • VM࣮ߦ͸໋ྩΛލ͍ͩ࠷దԽ͕Ͱ͖ͳ͍ͷͰɺେମ͋Δఔ౓͸ޮՌ͕͋Δ • ͨͩ͠ɺಛԽ໋ྩͷ͋ΔҰ෦ͷϝιου͸࠶ఆٛ͞Ε͍ͯͳ͍৔߹ʹྑ͘ޮ͘ͷͰɺASͷ ͍ͤͰ஗͘ͳΔౕ΋͋Δ͔΋
  47. ઓུ2: ϔομͷඇstaticؔ਺Λstaticʹ͢Δ • ର৅: ίϯύΠϧ࣌ؒͷ୹ॖ (MJIT͔ΒͷҠ২) • ະ࢖༻ͷstaticؔ਺͸ී௨ͷ -O2 ͳΒίϯύΠϧ͕ແࢹ͞ΕΔ͜ͱΛར༻

    • RubyͷεΫϦϓτ͕CͷίʔυΛਖ਼نදݱͰؾ߹Ͱม׵ (!?) • Railsʹޮ͔͘: ˕ • ίϯύΠϧ͕࣌ؒ଎͍ํ͕ͨ͘͞ΜίϯύΠϧͰ͖ΔͷͰɺ࣮֬ʹޮ͘
  48. ઓུ3: setjmpݺͼग़͠ΛεΩοϓͨ͠JITίʔυ௚઀ݺͼग़͠ • ର৅: ෆཁॲཧͷলུ (MJIT͔ΒͷҠ২) • Rubyͷྫ֎͸"setjmp", “longjmp"Ͱ࣮૷͞Ε͍ͯΔ͕ɺϚγϯͷίϯςΩετͷอଘ͕ඞཁͰ஗ ͍

    • ͜Ε͕ඞཁͳέʔεͷͨΊɺجຊతʹJITίʔυ͸VMΛىಈ͢Δؔ਺ʹϥοϓͯ͠ݺͼग़͍ͯ͠ Δ • ྫ֎͕ग़ͳͦ͏ͳόΠτίʔυͷ৔߹ʹɺͦͷϥοϓΛεΩοϓ͢Δ • Railsʹޮ͔͘: ◦ • ΞϓϦͰྫ֎Λ࢖͏ʹͯ͠΋RailsͷϨΠϠʔͰޮ͘৔ॴ͸͋Δఔ౓͋Γͦ͏
  49. ઓུ4: ࠷దԽʹ࣌ؒͷ͔͔Δؔ਺ͷΠϯϥΠϯԽΛආ͚Δ • ର৅: ίϯύΠϧ࣌ؒͷ୹ॖ (MJIT͔ΒͷҠ২) • CͷίʔυͷίϯύΠϧ࣌ؒ͸ɺύʔεͱ͔ڱٛͷίϯύΠϧ͸ҰॠͰɺ࠷దԽ͕஗͍ • ͳͷͰɺ࠷దԽ͕େมͳౕΛexternͰࢀর͢ΔΑ͏ʹ͢Ε͹ίϯύΠϧ͸଎͘ͳΔ

    • େมͳౕ: vm_search_method (ϝιου୳ࡧ) • ݺͼग़͢ͷ͕ඞཁͳ৔߹VM࣮ߦʹdeoptimizationΛ͢Δ • Railsʹޮ͔͘: ˚ • ͜Ε͸τϨʔυΦϑͷ͋Δ࠷దԽͰɺ͔ͳΓ௕͍࣌ؒ૸ΒͤΔRailsʹ͸ඍົͰ͢Ͷ
  50. ઓུ5: ؀ڥϙΠϯλͷॳظ஋ͷอଘ • ର৅: ෆཁॲཧͷলུ (MJIT͔ΒͷҠ২) • ͔ͳΓ͜Έ͍ͬͨ࿩ͳͷͰฉ͖ྲྀ͍ͯͩ͘͠͞ (Ͱ΋ޮՌ͋Δ) •

    YARV͸؀ڥϙΠϯλ(ep)ͱελοΫϙΠϯλ(sp)Λ࣋ͪɺͦΕΒ͸࠷ॳ͸ಉ͡஋ • deoptimization࣌spͷૢ࡞͕ཁΔ͕ɺϝιου಺ͰProcੜ੒ͳͲͰ؀ڥ͕࡞ΒΕͨ࣌ep͸ಈ͍ͯ͠·͏ • ͦͷࡍep͔Βͷspͷܭࢉ͕େมʹͳΔͷͰɺepͷॳظ஋Λอଘ͓ͯ͘͠ͱ଎͍ • Railsʹޮ͔͘: ˕ • Railsͩͱdeoptimizationͷػձଟͦ͏ͩ͠ɺޮ͖ͦ͏
  51. ઓུ6: VMʹؚ·Εͳ͍ϝιουͷΠϯϥΠϯԽ • ର৅: ؔ਺ͷΠϯϥΠϯԽ (MJIT͔ΒͷҠ২) • ϕʔεͷϔομ͸ vm.c ͔ΒͷΈ࡞͍ͬͯΔ͕ɺ౰વଞͷఆٛ΋͋ͬͨํ͕ྑ͍

    • optcarrotʹޮ͘ͷͰͱΓ͋͑ͣ Array#[] ͱ͔͚͖ͩ࣋ͬͯͯΈͨΒޮ͍ͨ • Railsʹޮ͔͘: ˕ • ͪΌΜͱ࣮૷ͷ࢓૊Έ͕൚༻ԽͰ͖Ε͹ޮ͖ͦ͏
  52. ઓུ7: ϝιουͷछྨ͝ͱʹҟͳΔϝιουݺͼग़͠ॲཧͷΠϯϥΠϯԽ • ର৅: ؔ਺ͷΠϯϥΠϯԽ (MJIT͔ΒͷҠ২) • CͰ࣮૷͞ΕͨϝιουͱRubyͰ࣮૷͞Εͨϝιουͷݺͼग़͠ॲཧ͸౰વҧ͏ • ͳͷͰVM໋ྩ͔ΒݟΔͱந৅Խ͞Ε͍ͯΔ

    • YARV͸όΠτίʔυʹΠϯϥΠϯΩϟογϡΛ͏Ί͜ΈɺͦΕ͕ϝιουͷλΠϓΛ ͍࣋ͬͯΔͷͰɺͦΕʹԠͯ͡ΠϯϥΠϯԽ͢Δ • Railsʹޮ͔͘: ˕ • ϝιουݺͼग़͕͠ଟ͍΄ͲޮՌ͕͋Δ
  53. RailsͰͷYARV-MJITͷ࢖͍ํ

  54. RailsͰͷYARV-MJITͷ࢖͍ํ • ී௨ʹϏϧυ: autoconf && ./configure && make && make

    install • rubyόΠφϦʹ͏·͍͜ͱ "-j" ϑϥάΛ౉͢
  55. RailsͰͷrubyͷΦϓγϣϯͷ౉͠ํ • RUBYOPT="-j" rails s • ruby -j bin/rails s

  56. ·ͱΊ • YARV-MJITΛಋೖͯ͠΋JITΛ੾ͬͨঢ়ଶͳΒ࣮֬ʹRails͕ಈ࡞͢Δ • JITΛ༗ޮʹͨ͠৔߹͸·ͩյΕΔϝιου͕͋ΔͷͰɺ௚͠த • YARV-MJIT/gcc ͕ੜ੒͢Δίʔυͷ଎౓͸͔ͳΓ MJIT/gcc ʹۙ͘ͳͬͨ

    • ·ͩࢼͤͳ͍͕Railsʹ΋ޮ͖ͦ͏ɺޤ͏͝ظ଴