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
Rustで正規表現エンジンっぽいのをアレした話
Search
KOBA789
March 01, 2017
0
220
Rustで正規表現エンジンっぽいのをアレした話
https://rust.connpass.com/event/48826/
でやったやつ
KOBA789
March 01, 2017
Tweet
Share
More Decks by KOBA789
See All by KOBA789
ついに生産が終わったけどZ80でまだまだ遊びたい
koba789
5
3.9k
ISUCONの練習を楽しくたくさんやる方法
koba789
2
440
Z80をRustで動かすまで年が越せない
koba789
0
160
ISUCON練習環境を最も簡単に用意する方法
koba789
2
3.1k
音をアレする
koba789
0
790
メガネとBluetooth Low Energyでお喋りする
koba789
0
1.5k
Rustでon-diskなB+Treeを作ったときの細かな話
koba789
11
1.7k
音の出るCPUを作っている途中
koba789
5
4.6k
自宅サーバーでbottlerocketを動かしてk8sクラスタを組む
koba789
1
1.1k
Featured
See All Featured
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.5k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
0
98
The Cult of Friendly URLs
andyhume
78
6.1k
Optimising Largest Contentful Paint
csswizardry
33
3k
For a Future-Friendly Web
brad_frost
175
9.4k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
Reflections from 52 weeks, 52 projects
jeffersonlam
347
20k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.9k
Navigating Team Friction
lara
183
15k
The Invisible Side of Design
smashingmag
298
50k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Transcript
RustͰVMܕਖ਼نදݱ ΤϯδϯͬΆ͍ͷΛ ΞϨͨ͠ KOBA789
KOBA789 • େֶΊͯྉཧΛָ͠Έʹ͢ΔձࣾͰࣾһ ͬͯΔ • ࣾͰδϟόॻ͍ͯΔ͠༰ͱؔͳ͍ • େੲʹNode.jsͷຊॻ͍ͨؾ͕͢Δ • Node.jsྲྀߦΒͤͯ͝ΊΜͳ͍͞
KOBA789 ͪΐ͏Ͳ2લʹ৮ͬͯͨΒ͍͠
MeCab(w/ IPA dic) Ͱղੳͨ͠ܗଶૉྻʹ ύλʔϯϚονΓ͍ͨ KOBA789
KOBA789
10ྻxNߦ NઍສΦʔμʔ KOBA789
ϕΫτϧྻʹਖ਼نදݱ KOBA789
ͳΜͱͳ͘VMܕ KOBA789
Rust͍͍ͱ͜Ζ • ྻڍܕ͕·ͱ • ྻڍܕͷύλʔϯϚον͕·ͱ • ཏੑνΣοΫࠓ࣌ৗࣝͩΑͶ • Unicodeจࣈྻͷѻ͍͕·ͱ •
Ͱ͍ͬͯ KOBA789
ॻ͍ͨ KOBA789
χʔϞχοΫ Jump:2 Fail Expect:1:໊ࢺ:1 Expect:2:αมଓ:1 Next Expect:1:ಈࢺ:1 Expect:5:αมɾεϧ:1 Match:OK Noop
KOBA789
ύϑΥʔϚϯε • Ϛγϯ: Xeon
[email protected]
/16GB RAM • ରϑΝΠϧ: 1.7GB 3400ສߦ
• ࣮ߦ࣌ؒ: 56.18sec (͖ͬ͞ଌͬͨ) • 30.26 MB/sec KOBA789
νϡʔχϯά • Xcode ͷ Instruments Λ͏ͱͳΜͱͳ͘ ϓϩϑΝΠϧͰ͖Δ • εΫϦϓτݴޠͬΆ͘ࡶʹॻ͍ͨͷͰ jemalloc͕ͨ͘͞Μ
KOBA789
ͦͷ͏ͪ • filebufferͱ͍͏crate͕͋ͬͯศརͦ͏ • mmap ͬΆ͍͜ͱ͢Δͭ • zero(less) allocation Ͱ͍͍ײ͡ʹϑΝΠϧ
ॲཧ͢ΔςΫχοΫΓ͍ͨ KOBA789
͔Μͦ͏ • ࠷ॳlifetimeʹ࿔͞Ε·ͬͨ͘ • ϝϞϦͷؾ࣋ͪʹͳΔͱॻ͖͍͢ • Boxͱ͔Arcͱ͔ҰճΘͳͯ͘ ͳΜͱ͔ͳΔ • ฒߦॲཧωοτϫʔΫͬͯͶ͐
• C++͋·Γॻ͔ͳ͍ͷͰmoveͱ͔Α͘Θ͔ͬͯͶ͐ KOBA789