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.8k
ISUCONの練習を楽しくたくさんやる方法
koba789
1
260
Z80をRustで動かすまで年が越せない
koba789
0
150
ISUCON練習環境を最も簡単に用意する方法
koba789
2
3k
音をアレする
koba789
0
770
メガネと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
Docker and Python
trallard
40
3.1k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
What's in a price? How to price your products and services
michaelherold
243
12k
Building Applications with DynamoDB
mza
90
6.1k
Being A Developer After 40
akosma
87
590k
Keith and Marios Guide to Fast Websites
keithpitt
409
22k
Imperfection Machines: The Place of Print at Facebook
scottboms
265
13k
The Pragmatic Product Professional
lauravandoore
31
6.3k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.2k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
How GitHub (no longer) Works
holman
310
140k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
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