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.6k
ISUCONの練習を楽しくたくさんやる方法
koba789
1
180
Z80をRustで動かすまで年が越せない
koba789
0
130
ISUCON練習環境を最も簡単に用意する方法
koba789
2
2.9k
音をアレする
koba789
0
760
メガネとBluetooth Low Energyでお喋りする
koba789
0
1.4k
Rustでon-diskなB+Treeを作ったときの細かな話
koba789
11
1.6k
音の出るCPUを作っている途中
koba789
5
4.5k
自宅サーバーでbottlerocketを動かしてk8sクラスタを組む
koba789
1
1.1k
Featured
See All Featured
Web development in the modern age
philhawksworth
204
10k
RailsConf 2023
tenderlove
26
790
Creatively Recalculating Your Daily Design Routine
revolveconf
215
12k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
248
20k
Done Done
chrislema
180
16k
How GitHub Uses GitHub to Build GitHub
holman
472
290k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
25
1.3k
KATA
mclloyd
27
13k
Web Components: a chance to create the future
zenorocha
308
41k
GitHub's CSS Performance
jonrohan
1029
450k
ParisWeb 2013: Learning to Love: Crash Course in Emotional UX Design
dotmariusz
109
6.9k
The Cult of Friendly URLs
andyhume
76
5.9k
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