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
680
Z80をRustで動かすまで年が越せない
koba789
0
160
ISUCON練習環境を最も簡単に用意する方法
koba789
2
3.1k
音をアレする
koba789
0
810
メガネと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.2k
Featured
See All Featured
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
3
180
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
870
Faster Mobile Websites
deanohume
305
30k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
173
51k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Automating Front-end Workflow
addyosmani
1366
200k
The Cost Of JavaScript in 2023
addyosmani
46
7.2k
4 Signs Your Business is Dying
shpigford
182
22k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
A Tale of Four Properties
chriscoyier
157
23k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
29
960
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