Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
Rustで正規表現エンジンっぽいのをアレした話
KOBA789
March 01, 2017
0
170
Rustで正規表現エンジンっぽいのをアレした話
https://rust.connpass.com/event/48826/
でやったやつ
KOBA789
March 01, 2017
Tweet
Share
More Decks by KOBA789
See All by KOBA789
メガネとBluetooth Low Energyでお喋りする
koba789
0
970
Rustでon-diskなB+Treeを作ったときの細かな話
koba789
10
940
音の出るCPUを作っている途中
koba789
5
3.8k
自宅サーバーでbottlerocketを動かしてk8sクラスタを組む
koba789
0
880
へんなOSを自宅で使う
koba789
0
75
Keyboard Firmware in Rust
koba789
0
440
Rust本番投入をあきらめるためのガイドライン
koba789
3
6.3k
Rubyの会社でRustを書くということ
koba789
3
2.4k
非同期ジョブと仲良くする
koba789
4
1.2k
Featured
See All Featured
How to train your dragon (web standard)
notwaldorf
57
3.8k
It's Worth the Effort
3n
172
25k
What's in a price? How to price your products and services
michaelherold
229
9.3k
Rebuilding a faster, lazier Slack
samanthasiow
62
7.2k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
29
4.3k
How To Stay Up To Date on Web Technology
chriscoyier
780
250k
Building a Scalable Design System with Sketch
lauravandoore
447
30k
Building Better People: How to give real-time feedback that sticks.
wjessup
343
17k
Designing Experiences People Love
moore
130
22k
Keith and Marios Guide to Fast Websites
keithpitt
404
21k
Done Done
chrislema
174
14k
4 Signs Your Business is Dying
shpigford
169
20k
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 E3-1220@3.2GHz/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