Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
JITコンパイラはいかにRailsを速くするか / Rails Developers Meet...
Search
Takashi Kokubun
December 09, 2017
Programming
4
4.2k
JITコンパイラはいかにRailsを速くするか / Rails Developers Meetup 2017
Rails Developers Meetup 2017 / k0kubun
Takashi Kokubun
December 09, 2017
Tweet
Share
More Decks by Takashi Kokubun
See All by Takashi Kokubun
YJIT Makes Rails 1.7x faster / RubyKaigi 2024
k0kubun
7
11k
Ruby JIT Hacking Guide / RubyKaigi 2023
k0kubun
2
9.3k
YJIT: Dive into Ruby's JIT compiler written in Rust / Rust.Tokyo 2022
k0kubun
1
2k
Towards Ruby 4 JIT / RubyKaigi 2022
k0kubun
3
11k
Optimizing Production Performance with MRI JIT / RubyConf 2021
k0kubun
1
400
Why Ruby's JIT was slow / RubyKaigi Takeout 2021
k0kubun
3
1.8k
数時間かかる週一リリースを毎日何度も爆速でできるようにするまで / CI/CD Conference 2021
k0kubun
21
14k
Ruby 3 JIT's roadmap / RubyConf China 2020
k0kubun
0
740
Ruby 3.0 JIT on Rails
k0kubun
9
9k
Other Decks in Programming
See All in Programming
タイミーにおけるデータの利用シーンと データ基盤の挑戦
marufeuille
4
3.1k
CSC509 Lecture 03
javiergs
PRO
0
130
(Deep|Web) Link support with expo-router
mrtry
0
110
ECS向けのドリフト検知機構を実装してみた
tkikuc
0
270
色んなオートローダーを覗き見る #phpcon_okinawa
o0h
PRO
5
370
ポケモンで考えるコミュニケーション / Communication Lessons from Pokémon
mackey0225
4
140
ACES Meet におけるリリース作業改善の取り組み
fukucheee
0
120
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
1.1k
Quarto Clean Theme
nicetak
0
220
VS Code extension: ドラッグ&ドロップでファイルを並び替える
ttrace
0
160
A Journey of Contribution and Collaboration in Open Source
ivargrimstad
0
140
What is TDD?
urakawa_jinsei
1
200
Featured
See All Featured
A designer walks into a library…
pauljervisheath
201
24k
Designing for Performance
lara
604
68k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
30
2.6k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
ParisWeb 2013: Learning to Love: Crash Course in Emotional UX Design
dotmariusz
109
6.9k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
230
17k
Why Our Code Smells
bkeepers
PRO
334
57k
Making Projects Easy
brettharned
114
5.8k
Fontdeck: Realign not Redesign
paulrobertlloyd
81
5.2k
Designing the Hi-DPI Web
ddemaree
279
34k
How GitHub (no longer) Works
holman
311
140k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
Transcript
JITίϯύΠϥ͍͔ʹ RAILSΛ͘͢Δ͔ RAILS DEVELOPERS MEETUP 2017
self #=> • @k0kubun • TreasureDataॴଐ • Rubyίϛολ • Hamlitͷ࡞ऀɺERBͱHamlͷϝϯςφ
• barbeque, mitamae, xremapΑΖ͘͠
࠷ۙRubyʹ͍Εͨػೳͷએ (Feature#14124) • binding.pry Έ͍ͨʹ binding.irb ͨ࣌͠ʹपลίʔυ͕දࣔ͞ΕΔΑ͏ʹͳΔ • ͜Ε͕͋ͬͯॳΊͯbinding.irbͨ͠ͱݴͬͯաݴͰͳ͍(?) •
ଞʹRuby 2.5ͰͳΜͱ require "irb" ͠ͳͯࣗ͘ಈͰϩʔυ͞ΕΔΑ͏ʹͳΓɺ binding.irb ͕ศརʹͳΔ
None
ಥવͰ͕͢ɺTDͰಇ͖͍ͨ ํ͍·ͤΜ͔ʁ
օ͞Μ͕ԿނTDʹԠื͠ͳ͍ͷ͔ෆ໌ • ࢄDBΫϥυͷཪଆΛݟΒΕΔɺ։ൃ͕Ͱ͖Δ • ༷ʑͳͷ༏लͳಉ྅ͱҰॹʹࣄ͕Ͱ͖Δ • Fluentd, Embulk, DigdagOSS։ൃ͕ࣄʹͰ͖Δ •
γϦίϯόϨʔग़ࢿͷ۰ɺۈ࣌ؒͷࣗ༝ߴ͍
RailsͰग़དྷ͍ͯΔίϯϙʔωϯτୡ • ϓϩμΫτ • Treasure Data Service • Customer Data
Platform • Enterprise Fluentd Management Console • ϚΠΫϩαʔϏε • Embulk config management API
Treasure Data Service ͷνʔϜ • kamipo (ϦϞʔτ) • ϑΣϧφϯυ (US,
ϦϞʔτ) • uu59 • k0kubun • makimoto
k0kubunͱJIT ͜Ε·Ͱͷ͋Β͢͡
20174݄: ͬͱ͍Rubyཉ͠ ͍ͳ… → JIT͚ͩॻ͚Αͦ͞͏
20174-6݄: C++ͱLLVMΛษڧ͠ͳ͕Βɺ CRuby͚ͷελοΫϕʔεͷϝιουJITΛ ։ൃ
20177݄: ຊମͷϚʔδΛເݟ ͯCʹॻ͖͠ "LLRB" ͱͯ͠ެ։
20177-8݄: MJIT͕ຊମʹೖΓͦ͏ͩ͠ LLRB͍͍͔ͱ͍͏ؾ࣋ͪʹͳΓɺGraphQL Ͱ༡ΜͰ͍ͨ
20179݄: RubyKaigiͰͷϨδελϕʔεͷϝ ιουJIT "MJIT" ͷൃදޙɺϦεΫΛऔΒͣε λοΫϕʔεͷ··Ͱ͍JITΛ࡞Δ͜ͱΛܾҙ
201710݄: MJITͷ͏ͪJITίʔυੜ෦͚ͩஔ ͖͑ͨ "YARV-MJIT" Λ։ൃɺެ։ (optcarrot: YARV-MJIT/gcc 56.4, MJIT/gcc 75.6)
201711݄: RubyConfʹ͚YARV-MJITߴ ԽɺpthreadҠ২ɺWindowsରԠ (optcarrot: YARV-MJIT/gcc 69.4, MJIT/gcc 75.6)
201712݄: railsdm2017 ͰJIT͕RailsʹͲΕ͘ Β͍ޮՌ͕͋Δ͔͢༧ఆ͕ͩͬͨɺYARV-MJIT ΛRailsͰಈ͔͠ଓ͚ΔͱյΕΔ͜ͱʹؾ͘
201712݄: RailsͰಈ͘Α͏ʹ͘͢Ұࡢ͔ ΒYARV-MJITͷج൫ͷॻ͖͠Λ࢝Ίɺͦͷϒ ϥϯνͰΑΓ҆ఆͯ͠ಈ͘Α͏ʹͳͬͨ
͔͠͠RailsͰಈ͔ͯ͠Δͱ ͬͺ͍͔ͭյΕΔ
ͳͷͰࠓ͜͏͍͏Λ͠·͢ • CRuby͚ͷJITͷݱঢ় • Ͳͷ͘Β͍Rails͕ಈ͔ͤΔͷ͔ • ϕϯνϚʔΫ݁Ռ • YARV-MJIT͕ߦͳ͏࠷దԽͷΈ •
ͦΕͧΕͷRailsͷΠϯύΫτͷ༧ • RailsͰͷYARV-MJITͷ͍ํ
CRuby͚ͷJITͷݱঢ়
CRuby͚ͷJITͨͪ • RuJIT: TraceϕʔεɺϝϞϦ༻ྔ͕ʹͳ༷ͬͨ • Eclipse OMR: Optcarrotͩͱ͘ͳΒͳ͍Β͍͠ • LLRB:
LLVMਏ͍ɺͪ͜Β͔ΒҎ্ • MJIT: ͍ɺগͳ͍ϝϞϦফඅɺมͳґଘͳ͍ • YARV-MJIT: ͪΐͬͱMJITΑΓ͍͕ɺVMଆ͕όάΒͳ͍
ࠓMJIT, YARV-MJITͷ͚ͩ͠·͢ • RuJIT: TraceϕʔεɺϝϞϦ༻ྔ͕ʹͳ༷ͬͨ • Eclipse OMR: Optcarrotͩͱ͘ͳΒͳ͍Β͍͠ •
LLRB: LLVMਏ͍ɺͪ͜Β͔ΒҎ্ • MJIT: ͍ɺগͳ͍ϝϞϦফඅɺมͳґଘͳ͍ • YARV-MJIT: ͪΐͬͱMJITΑΓ͍͕ɺVMଆ͕όάΒͳ͍
MJITͱ • GitHub: vnmakarov/ruby • CRubyͷͨΊͷϝιουJITίϯύΠϥ • JITίϯύΠϥ͚ͩͰͳ͘ɺϕʔεͷVM໋ྩஔ͖͑ • JIT༻pthread͕gccclangΛfork,
execͯ͠dlopen, dlsym • ͜ͷͨΊWindowsͰಈ͔ͳ͍ • http://rubykaigi.org/2017/presentations/vnmakarov.html
YARV-MJITͱ • GitHub: k0kubun/yarv-mjit • MJITΛΑΓอकతʹͨ͠ϑΥʔΫ, trunkʹैத • JITج൫Λվળͭͭ͠ɺVM໋ྩஔ͖͑ͳ͍ •
MJITʹগ͠ྼΔ͕ɺRuby 2.5ΑΓेߴ • pthread෦ΛWindows͚ʹҠ২ࡁɺMinGWͰશʹಈ࡞
ԿނYARV-MJITΛ։ൃ͍ͯ͠Δͷ͔ • RubyΛόάͳ͘ϦϦʔε͍ͯͨ͘͠Ίʹɺ͍͖ͳΓMJITΛೖΕΔͷͦ͠͏ • VM໋ྩͷஔ͖͑ϦεΩʔ (YARV͕ೖͬͨRuby 1.9࠷ॳ͔ͳΓյΕ͍༷ͯͨ) • JITΦϓγϣφϧͳͷͰࢼݧతʹಋೖ͍͕͢͠ɺVMͷมߋόάΔͱճආͰ͖ͳ͍ •
ͦΕͱಉ࣌ʹҠ২ੑΛղܾ͠ͳ͕ΒJITج൫ಋೖ͢Δඞཁ͕͋Δ • VMͦͷ··Ͱಈ͘γϯϓϧͳJIT (YARV-MJIT) ΛͱΓ͋͑ͣೖΕͯΈͨΒͲ͏͔ • ෦తʹupstreamʹ͋ΔͱMJIT͕ίϯϑϦΫτ͠ʹ͘͘ͳΓɺڞ༗͍ͯ͠ΔJITج൫ڠ ྗͯ͠։ൃ͘͢͠ͳΔ
ͰɺRailsͰಈ͘ΜͰ͔͢ʁ
ͦͦRubyຊମͷςετ͕ͲͪΒશ෦௨Βͳ͍ .+*5 :"37.+*5 NBLFUFTUUFTUBMMTQFD XJUIPVU+*5 ˓ºº ˓˓˓ NBLFUFTUUFTUBMMTQFD XJUI+*5 ˓ºº
ºº˓
MJIT on Rails • MJIT͕ϕʔεʹ͍ͯ͠ΔRTL໋ྩͷVMͰffi͕ಈ͔ͳ͍ • rubyͷtest-allͱ͔rubyspecམͪΔ • ͳͷͰJIT͕༗ޮ͔Ͳ͏͔ʹؔΘΒͣɺݱঢ়Railsىಈෆೳ •
ͨͩ͠ɺVladimirRTLΛYARV→JIT࣌ͷதؒදݱʹมߋதΒ͍͠ͷͰղܾ͞ΕΔ͔ ͠Εͳ͍͕ɺະެ։ͷͨΊෆ໌
YARV-MJIT on Rails • VMʹ΄΅ϊʔλονͳͷͰJIT͕ແޮͷঢ়ଶͰRailsͩΖ͏͕શʹಈ࡞͢Δ • JIT༗ޮͩͱଟ͓͔͍͠ίϯύΠϧΛ͍ͯ͠Δͷ͕͍͔͋ͬͯͭམͪΔ • Ϛʔδ͢Δʹͯ͜͠Εղܾ͔ͯ͠ΒͰ͠ΐ͏Ͷ
ϕϯνϚʔΫ݁Ռ
Ruby 3x3 ͷ֬ೝʹΘΕ͍ͯΔϕϯνϚʔΫ • mame/optcarrot • Rubyίϛολͷԕ౻͞Μ࡞ NESΤϛϡϨʔλͷϕϯν • noahgibbs/rails_ruby_bench
• Noah GibbsʹΑΔ RailsΞϓϦdiscourseΛͬͨϕϯν
mame/optcarrot 0QUDBSSPUXJUI
[email protected]
GQT Ruby 2.0
Ruby 2.5 YARV-MJIT MJIT
noahgibbs/rails_ruby_bench • MJIT, YARV-MJIT ͕RailsͰಈ͔͘Ͳ͏͔Ҏલʹ͜ͷϕϯνϚʔΫͷ࣮ߦ͕͍͠ • RubyͱRailsͷίϛολʔͷদా͞Μಈ͔ͤͳ͔ͬͨ͠ɺಈ͔ͤͳ͔ͬͨ • ͳͷͰɺࠓͪΐͬͱࣗͰRailsͷϕϯνϚʔΫΛॻ͖࢝Ί͍ͯΔ
Ruby Grant 2017ͷϕϯν ϚʔΫϓϩδΣΫτʹ͍ͭͯ
Ruby Grant 2017ͬͯ·͢ • Ruby Grant ͱ: 50ສԁΛ͍͍ͨͩͯRubyʹߩݙ͢Δౕ • ϕϯνϚʔΫڥͷඋΛ͍ͬͯ·͢
• benchmark_driver.gem • ैདྷͷϕϯνϚʔΧʔʹଘࡏ͢ΔProcݺͼग़͠ͷΦʔόʔϔου͕ͳͤ͘Δ • ϝϞϦ༻ྔΛܭଌͨ͠ΓɺΞτϓοτΛϓϥάΠϯͰࣗ༝ʹม͑ͨΓ • ͋ͱͦΕΛͬͯϕϯνϚʔΫηοτͷ֦ॆͱɺCIڥΛ༻ҙ͠·͢ • ࠷ऴతʹRubyBenchͷ߹ྲྀࢹ
ϕϯνϚʔΫηοτͷ֦ॆʹ͍ͭͯ • RubyͷίΞΫϥεͷϝιουͷΧόϨοδΛ্͍͛ͯ͘ • Railsͱ͔Fluentdͱ͔ͷϕϯνϚʔΫॻ͜͏ͱࢥ͍ͬͯΔ • RailsΓ࢝Ίͨ: https://github.com/benchmark-driver/rails-benchmarks • ActionViewͷϕϯνॻ͍ͯͨͱࢥͬͨΒςϯϓϨʔτΤϯδϯΛϕϯν͍ͯͨ͠
YARV-MJITͷ࠷దԽͷΈ
YARV-MJITͷ࠷దԽͷΈ QVUPCKFDU QVUPCKFDU PQU@NVMU MFBWF $BMMDPVOU :"37CZUFDPEF 5ISFBE3VCZ7. 5ISFBE+*5DPNQJMFS *OUFSQSFU
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
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
͜ͷݩͷੜίʔυΛݡ͘͠ͳ͍ͱ͘ͳΒͳ͍ͷͰɺͦͷ #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
JITίʔυͷ࠷దԽઓུ
JITίʔυͷ࠷దԽઓུ • ͕RubyKaigi 2017ͷΩʔϊʔτʹٻΊ͍͚ͯͨͲ͞Εͳ͔ͬͨ෦ • MJITͱYARV-MJITͷίϯύΠϥผ͕ͩɺ͞ͷຊ࣭తͳཧ༝ଟ͘ڞ༗͍ͯ͠Δ • MJIT͕͍ཧ༝ϕʔεͷ໋ྩ͕Ϩδελϕʔε͔ͩΒͰͳ͍ͱࢥ͍ͬͯΔ • ͜ΕҎ߱ͷ༰ͰͦΕΛূ໌
جຊΞΠσΞ • ݱࡏओʹҎԼͷ3छྨͷ࠷దԽʹϑΥʔΧε: • ؔͷΠϯϥΠϯԽ • ෆཁॲཧͷলུ • ίϯύΠϧ࣌ؒͷॖ •
ͦΕͧΕRailsʹޮՌ͕͋Γͦ͏͔ߟΛ͍Ε·͢ • ͠શ෦ޮՌ͋ΔͳΒɺRailsͷRubyͷϨΠϠʔ͕ಉ͘͡Β͍͘ͳΔͣ
ઓུ1: VMͷίʔυΛͳΔ͘ϔομʹؚΊΠϯϥΠϯԽ͢Δ • ର: ؔͷΠϯϥΠϯԽ (MJIT͔ΒͷҠ২) • ίϯύΠϥίϯύΠϥʹ͞Εͨίʔυ͔͠࠷దԽͰ͖ͳ͍ͷͰɺఆٛΛ͢ • ୯ʹ
vm.c ΛϓϦϓϩηεͨ͠ͷΛϔομͱͯ͠Πϯετʔϧ • Railsʹޮ͔͘: ◦ • VM࣮ߦ໋ྩΛލ͍ͩ࠷దԽ͕Ͱ͖ͳ͍ͷͰɺେମ͋ΔఔޮՌ͕͋Δ • ͨͩ͠ɺಛԽ໋ྩͷ͋ΔҰ෦ͷϝιου࠶ఆٛ͞Ε͍ͯͳ͍߹ʹྑ͘ޮ͘ͷͰɺASͷ ͍ͤͰ͘ͳΔౕ͋Δ͔
ઓུ2: ϔομͷඇstaticؔΛstaticʹ͢Δ • ର: ίϯύΠϧ࣌ؒͷॖ (MJIT͔ΒͷҠ২) • ະ༻ͷstaticؔී௨ͷ -O2 ͳΒίϯύΠϧ͕ແࢹ͞ΕΔ͜ͱΛར༻
• RubyͷεΫϦϓτ͕CͷίʔυΛਖ਼نදݱͰؾ߹Ͱม (!?) • Railsʹޮ͔͘: ˕ • ίϯύΠϧ͕͍࣌ؒํ͕ͨ͘͞ΜίϯύΠϧͰ͖ΔͷͰɺ࣮֬ʹޮ͘
ઓུ3: setjmpݺͼग़͠ΛεΩοϓͨ͠JITίʔυݺͼग़͠ • ର: ෆཁॲཧͷলུ (MJIT͔ΒͷҠ২) • Rubyͷྫ֎"setjmp", “longjmp"Ͱ࣮͞Ε͍ͯΔ͕ɺϚγϯͷίϯςΩετͷอଘ͕ඞཁͰ ͍
• ͜Ε͕ඞཁͳέʔεͷͨΊɺجຊతʹJITίʔυVMΛىಈ͢Δؔʹϥοϓͯ͠ݺͼग़͍ͯ͠ Δ • ྫ֎͕ग़ͳͦ͏ͳόΠτίʔυͷ߹ʹɺͦͷϥοϓΛεΩοϓ͢Δ • Railsʹޮ͔͘: ◦ • ΞϓϦͰྫ֎Λ͏ʹͯ͠RailsͷϨΠϠʔͰޮ͘ॴ͋Δఔ͋Γͦ͏
ઓུ4: ࠷దԽʹ࣌ؒͷ͔͔ΔؔͷΠϯϥΠϯԽΛආ͚Δ • ର: ίϯύΠϧ࣌ؒͷॖ (MJIT͔ΒͷҠ২) • CͷίʔυͷίϯύΠϧ࣌ؒɺύʔεͱ͔ڱٛͷίϯύΠϧҰॠͰɺ࠷దԽ͕͍ • ͳͷͰɺ࠷దԽ͕େมͳౕΛexternͰࢀর͢ΔΑ͏ʹ͢ΕίϯύΠϧ͘ͳΔ
• େมͳౕ: vm_search_method (ϝιου୳ࡧ) • ݺͼग़͢ͷ͕ඞཁͳ߹VM࣮ߦʹdeoptimizationΛ͢Δ • Railsʹޮ͔͘: ˚ • ͜ΕτϨʔυΦϑͷ͋Δ࠷దԽͰɺ͔ͳΓ͍࣌ؒΒͤΔRailsʹඍົͰ͢Ͷ
ઓུ5: ڥϙΠϯλͷॳظͷอଘ • ର: ෆཁॲཧͷলུ (MJIT͔ΒͷҠ২) • ͔ͳΓ͜Έ͍ͬͨͳͷͰฉ͖ྲྀ͍ͯͩ͘͠͞ (ͰޮՌ͋Δ) •
YARVڥϙΠϯλ(ep)ͱελοΫϙΠϯλ(sp)Λ࣋ͪɺͦΕΒ࠷ॳಉ͡ • deoptimization࣌spͷૢ࡞͕ཁΔ͕ɺϝιουͰProcੜͳͲͰڥ͕࡞ΒΕͨ࣌epಈ͍ͯ͠·͏ • ͦͷࡍep͔Βͷspͷܭࢉ͕େมʹͳΔͷͰɺepͷॳظΛอଘ͓ͯ͘͠ͱ͍ • Railsʹޮ͔͘: ˕ • Railsͩͱdeoptimizationͷػձଟͦ͏ͩ͠ɺޮ͖ͦ͏
ઓུ6: VMʹؚ·Εͳ͍ϝιουͷΠϯϥΠϯԽ • ର: ؔͷΠϯϥΠϯԽ (MJIT͔ΒͷҠ২) • ϕʔεͷϔομ vm.c ͔ΒͷΈ࡞͍ͬͯΔ͕ɺવଞͷఆٛ͋ͬͨํ͕ྑ͍
• optcarrotʹޮ͘ͷͰͱΓ͋͑ͣ Array#[] ͱ͔͚͖ͩ࣋ͬͯͯΈͨΒޮ͍ͨ • Railsʹޮ͔͘: ˕ • ͪΌΜͱ࣮ͷΈ͕൚༻ԽͰ͖Εޮ͖ͦ͏
ઓུ7: ϝιουͷछྨ͝ͱʹҟͳΔϝιουݺͼग़͠ॲཧͷΠϯϥΠϯԽ • ର: ؔͷΠϯϥΠϯԽ (MJIT͔ΒͷҠ২) • CͰ࣮͞ΕͨϝιουͱRubyͰ࣮͞Εͨϝιουͷݺͼग़͠ॲཧવҧ͏ • ͳͷͰVM໋ྩ͔ΒݟΔͱநԽ͞Ε͍ͯΔ
• YARVόΠτίʔυʹΠϯϥΠϯΩϟογϡΛ͏Ί͜ΈɺͦΕ͕ϝιουͷλΠϓΛ ͍࣋ͬͯΔͷͰɺͦΕʹԠͯ͡ΠϯϥΠϯԽ͢Δ • Railsʹޮ͔͘: ˕ • ϝιουݺͼग़͕͠ଟ͍΄ͲޮՌ͕͋Δ
RailsͰͷYARV-MJITͷ͍ํ
RailsͰͷYARV-MJITͷ͍ํ • ී௨ʹϏϧυ: autoconf && ./configure && make && make
install • rubyόΠφϦʹ͏·͍͜ͱ "-j" ϑϥάΛ͢
RailsͰͷrubyͷΦϓγϣϯͷ͠ํ • RUBYOPT="-j" rails s • ruby -j bin/rails s
·ͱΊ • YARV-MJITΛಋೖͯ͠JITΛͬͨঢ়ଶͳΒ࣮֬ʹRails͕ಈ࡞͢Δ • JITΛ༗ޮʹͨ͠߹·ͩյΕΔϝιου͕͋ΔͷͰɺ͠த • YARV-MJIT/gcc ͕ੜ͢Δίʔυͷ͔ͳΓ MJIT/gcc ʹۙ͘ͳͬͨ
• ·ͩࢼͤͳ͍͕Railsʹޮ͖ͦ͏ɺޤ͏͝ظ