Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
遅延評価と健康
Search
Susisu
October 16, 2016
Programming
690
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
遅延評価と健康
遅延評価でパーサコンビネータを高速化した話
http://connpass.com/event/39553/
Susisu
October 16, 2016
More Decks by Susisu
See All by Susisu
tsc.rip を支える技術 / Kyoto.なんか #8
susisu
0
4.6k
これって Effect でできたのでは? / TSKaigi Mashup Kansai #2
susisu
0
310
Stage 3 Decorators でできること / できないこと / TSKaigi 2026
susisu
1
2.5k
Go で言うところのアレは TypeScript で言うとコレ / Kyoto.なんか #7
susisu
7
2.9k
君だけのオリジナル async / await を作ろう / TSKaigi 2025
susisu
20
16k
null or undefined
susisu
25
8k
Mackerel のフロントエンドフレームワーク移行 序章 / Hatena Engineer Seminar #13
susisu
0
2.3k
スクリーンショット撮影のために Puppeteer を操る / Kyoto.js 16
susisu
0
1k
BuckleScript 使ってみた
susisu
0
440
Other Decks in Programming
See All in Programming
選挙速報を多くのユーザーへ 届ける Live Activities 設計
hamayokokuririn
0
160
iOS 27でニュースアプリはどう変わる!? 〜日経電子版の新機能対応と、開発事例から〜
lynnswap
6
13k
AgentCore CLI で進化した AWS での AI エージェントの作り方 : 必要な機能を必要な時に
icoxfog417
PRO
3
380
速く作れる。その次は、速く確かめられる開発へ 〜AIネイティブ開発を支える、Shift Down〜 / Can build fast. Next, moving to development where we can verify fast.
rkaga
6
4.6k
Go × SIMDで高速化するベクトル検索 ~ルーフラインモデルでSIMDが効く境界を探れ! ~
po3rin
1
3.5k
モジュールの視点からSwiftを読み解く #iosdc
s_shimotori
0
190
Omarchy Tokyo やると聞いて UMPC 買ってセットアップしてきた
mtsmfm
0
160
そのリトライ、死んだコネクションを使い回していませんか ── GoのHTTPクライアントとHTTP/2を実プロダクト障害から学び直す
myus4a
0
250
IBM Bob Dojo #1 仕様駆動開発入門
oniak3ibm
PRO
0
220
Streamlitで実現する自然言語データアプリ開発
ayumu_yamaguchi
1
320
The Rails Doctrine Decade
koic
2
380
速習iPhone Duo対応
yuukiw00w
2
760
Featured
See All Featured
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Evolving SEO for Evolving Search Engines
ryanjones
0
300
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.3k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.6k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
830
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
Build your cross-platform service in a week with App Engine
jlugia
234
19k
From π to Pie charts
rasagy
1
380
Measuring & Analyzing Core Web Vitals
bluesmoon
9
1k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
370
Transcript
Ԇ ධ Ձ ͱ ݈ ߁ 2 0 1
6 - 1 0 - 1 6 O U C C LT ձ # 5 @susisu2413
Ԇ ධ Ձ Ͱ ύ ʔ α ί ϯ
Ϗω ʔ λ Λ ޮ Խ ͠ ͨ Λ ͠ · ͢
ύ ʔ α ί ϯ Ϗω ʔ λ ʁ
ߏ จ ղ ੳ ͢ Δ ͭ h t
t p s : / / e n . w i k i p e d i a . o rg / w i k i / P a r s e r _ c o m b i n a t o r
ೖ ྗ Τ ϥ ʔ Γ ύʔα ύʔαΛؔͰදݱ
ʢ࣮༻্ΦϒδΣΫτͰϥοϓʣ
ೖ ྗ Τ ϥ ʔ Γ ύʔα ύ
ʔ α ύ ʔ α ύʔα ίϯϏωʔλ ύʔαίϯϏωʔλͰΑΓෳࡶͳύʔαΛߏங
༗ ໊ ͳ ͷ P a r s e c
( H a s k e l l ) h t t p s : / / g i t h u b . c o m / a s l a t t e r / p a r s e c P a r s i m m o n ( J a v a S c r i p t ) h t t p s : / / g i t h u b . c o m / j n e e n / p a r s i m m o n
࡞ ͬͯ Έ ͨ ʢ 2 લ ʣ
J a v a S c r i p t
Ͱ P a r s e c ؙ ύ Ϋ Ϧ h t t p s : / / g i t h u b . c o m / s u s i s u / L o q u a t
ͱ ͯ ศ ར ࣗ ࡞ ε Ϋ Ϧ
ϓ τ ݴ ޠ G r a s s ί ϯύ Π ϥ ︙
ੑ ೳ ʁ
1000ߦͷ JSON × 1000ճ (Node.js v6.7.0) ൺ ֱ
Parsimmon: 4.8 sec PEG.js: 8.47 sec Loquat: 72724ms ࣗ࡞: ? sec
1000ߦͷ JSON × 1000ճ ൺ ֱ Parsimmon: 4.8
sec PEG.js: 8.47 sec ࣗ࡞: 72.7 sec
None
ͳ ͥ ͍ ʁ
V 8 ͷ ϓ ϩ ϑ Ν Π ϥ Ͱ
ௐ Δ node --prof parse.js node --prof-process isolate-0x*-v8.log https://github.com/v8/v8/wiki/Using%20V8’s %20internal%20profiler
͍ ͷ ͨ ͪ ύ ʔ α ͷ
݁ ߹ จ ࣈ ͷ ύ ʔε Τ ϥ ʔ ॲ ཧ
ࠓ ͷ ϝ Π ϯ Τ ϥ ʔ ॲ
ཧ
Τ ϥ ʔ ॲ ཧ ߏ จ ղ ੳ ࣦ
ഊ ࣌ ʹ ώ ϯ τ Λ ग़ ͢ ͨ Ί ϝ ο η ʔ δ ྻ ͷ ݁ ߹ ͳ Ͳ
ࣦ ഊ ͠ ͨ ͱ ͖ ͷ Έ ඞ ཁ
ࣦ ഊ ͢ Δ · Ͱ ܭ ࢉ ͠ ͳ
͍
Ԇ ධ Ձ
ܭ ࢉ Λ Ԇ ͞ ͤ Δ ʹ
ʁ let x = 1 + 2;
Ϋ ϩ ʔ δ ϟ ʹ ͢ Ε ྑ
͍ let x = () => 1 + 2;
ຖ ճ ؔ ݺ ͼ ग़ ͠ Ω ϟ
ο γ ϡ ͞ Ε ͳ ͍ ͍ ͮ Β ͍
Φ ϒ δΣ Ϋ τ Ͱ ϥ ο ϓ
ΠϯλʔϑΣʔε͕ڞ௨ͨ̎ͭ͠ͷΫϥεΛ࡞ ParseError LazyParseError ௨ৗ൛ Ԇ൛
σʔλΛՃ͢Δͱ͖Ԇ൛Ͱ ܭࢉΛԆͤ͞Δ ParseError LazyParseError Ճʢ݁߹ͳͲʣ Ճ
௨ৗ൛Ͱ getter ͦͷ··Λฦ͢ ParseError LazyParseError
Ԇ൛Ͱ getter ධՁ͔ͯ͠ΒΛฦ͢ ParseError LazyParseError ධՁ ݁ՌΩϟογϡ
݁ Ռ
1000ߦͷ JSON × 1000ճ ൺ ֱ ݩ: 72.7
sec վྑ൛: 28.4 sec ԆධՁ͋Γ: ? sec
1000ߦͷ JSON × 1000ճ ൺ ֱ ԆධՁ͋Γ: 11.2
sec ݩ: 72.7 sec վྑ൛: 28.4 sec
1000ߦͷ JSON × 1000ճ ൺ ֱ Parsimmon: 4.8
sec PEG.js: 8.47 sec վྑ൛ + ԆධՁ: 11.2 sec
· ͱ Ί
Ԇ ධ Ձ ͍ ͍ ͧ ܭ ࢉ
ͷ ޮ Խ ଞ ʹ ॥ ఆ ٛ ͳ Ͳ
ܽ ͋ Δ ͷ Ͱ ҙ ࣌
ؒ ɾ ۭ ؒ త ί ε τ ࢥ Θ ͵ ε λ ο Ϋ ͷ ফ අ
ύ ʔ α ί ϯ Ϗω ʔ λ v 2
͝ ظ Լ ͞ ͍ h t t p s : / / g i t h u b . c o m / s u s i s u / l o q u a t - c o re