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
WebAssembly で 世界最速の数独ソルバーを作った話
Search
Yuto Ono
May 22, 2023
0
1k
WebAssembly で 世界最速の数独ソルバーを作った話
Yuto Ono
May 22, 2023
Tweet
Share
More Decks by Yuto Ono
See All by Yuto Ono
1_年間_EM_エンジニアリングマネージャー_を経験した人の話.pdf
yutoono
0
58
EMを目指す方法
yutoono
1
180
Svelte でルービックキューブを作ってみた
yutoono
1
220
レガシーなフロントエンドを_React___Next.js_にリプレースした結果.pdf
yutoono
0
1.2k
レガシーなフロントエンドを リプレースするプラクティス。 エネチェンジが挑む 「React化」
yutoono
4
2k
AWS Codebuild のすすめ
yutoono
0
1.4k
Featured
See All Featured
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.5k
Building Applications with DynamoDB
mza
96
6.7k
YesSQL, Process and Tooling at Scale
rocio
173
14k
Automating Front-end Workflow
addyosmani
1371
200k
Large-scale JavaScript Application Architecture
addyosmani
514
110k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
657
61k
Unsuck your backbone
ammeep
671
58k
Typedesign – Prime Four
hannesfritz
42
2.8k
Building Better People: How to give real-time feedback that sticks.
wjessup
369
20k
How to train your dragon (web standard)
notwaldorf
97
6.3k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.7k
Transcript
WebAssembly で 世界最速の数独ソルバーを作った話 by Yuto
Yuto の自己紹介 • 1995年生まれ(28歳) • ENECHANGE株式会社 • フロントエンドエンジニア • TypeScript,
React, Next.js • 趣味で Svelte, Solid, Rust, WebAssembly など • Deno 気になる
最近、WebAssembly (Wasm) 流行っていますね • Amazon Prime Videoが動画再生にWebAssemblyを採用 • Figma is
powered by WebAssembly • WebAssembly対応でRubyは何が出来るようになったのか?
僕も WebAssembly 触ってみたい
でも、普通にTutorialやるだけじゃ つまんないな
そうだ、数独を普通のJSとWasmで実装して比 較してみよう
JavaScript (TypeScript) での実装 数独を一瞬で解いてしまうプログラム 平均 6.1ms
Rust + Wasm での実装 数独を一瞬で解いてしまうプログラム(Rust版) 平均 2.2ms!! 圧勝! JSよりも3.9ms速いという結果に
ちなみに せっかくなのでロジック部分をnpmで公開しちゃいましたw https://www.npmjs.com/package/sudoku-solver-ts
まとめ 詳しいことはこちらの記事に書いたので興味のある方は読んでください Rust + WebAssembly で、世界最速の数独ソルバーを作った話 [bitboard] - Qiita WebAssembly
は、今のところ、パフォーマンス最適化の目的で Rust や C++ などの高 速な言語が選ばれているが、今後、好きな言語でフロントエンド開発できるという用途で も使われるようになるかも? Rubyでフロントエンドを書くという時代がやってくるかも!
PR ENECHANGEではエネルギー問題に興味のある エンジニアを絶賛募集しています! ENECHANGE(エネチェンジ) エンジニア採用サイト 社会の動きと連動しながら、サービスを改善し続ける。「エネ チェンジ」の開発にはそんな面白さがある | ENECHANGE 株式会社