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
700
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.9k
これって Effect でできたのでは? / TSKaigi Mashup Kansai #2
susisu
0
350
Stage 3 Decorators でできること / できないこと / TSKaigi 2026
susisu
1
2.6k
Go で言うところのアレは TypeScript で言うとコレ / Kyoto.なんか #7
susisu
7
2.9k
君だけのオリジナル async / await を作ろう / TSKaigi 2025
susisu
20
16k
null or undefined
susisu
25
8.1k
Mackerel のフロントエンドフレームワーク移行 序章 / Hatena Engineer Seminar #13
susisu
0
2.3k
スクリーンショット撮影のために Puppeteer を操る / Kyoto.js 16
susisu
0
1k
BuckleScript 使ってみた
susisu
0
450
Other Decks in Programming
See All in Programming
Spec-Driven Development - Why Vaadin Is the Perfect Fit
simas
PRO
0
230
私なりのハーネスエンジニアリング ~独自の言語処理系の開発を通して~
seosoft
0
180
プロジェクトコードをキレイキレイしよう!暗黙的な参照を読み解く静的解析
ostk0069
0
210
Seven New Principles of Software Engineering
yegor256
0
460
学びを記事・スライド・Xへ高速展開する― AI-assisted Learning Loopで回すコンテンツ生成術
ochtum
0
200
Apple Intelligenceとオンデバイス時代の到来
yahir0
0
230
Railsバージョンを4倍にした話
optim
0
950
AI時代のシニアエンジニアとは
yosuke_furukawa
PRO
15
11k
AmebaブログはKMPから卒業します
kmars0605
0
330
あなたの await、OS まで届いてる? strace で覗く JavaScript の非同期
hasutosasaki
1
2.2k
S3 TablesのIcebergデータに、AIエージェントからアクセスしてみた / 20261016developersio2026joetsu-accessing-iceberg-in-s3tables-via-agent
kasacchiful
PRO
0
280
Materialが消えた日 〜真っ白なFlutterキャンバスにRenderObjectで絵を描く〜
umigishiaoi
0
150
Featured
See All Featured
The Cult of Friendly URLs
andyhume
79
7.1k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
550
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.5k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.9k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.7k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3.1k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
4 Signs Your Business is Dying
shpigford
187
23k
30 Presentation Tips
portentint
PRO
1
460
How to build a perfect <img>
jonoalderson
1
6.2k
The Curse of the Amulet
leimatthew05
3
17k
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