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
A description of Hono Prepared Router
Search
EdamAmex
December 20, 2024
Technology
0
39
A description of Hono Prepared Router
A description of Hono Prepared Router
EdamAmex
December 20, 2024
Tweet
Share
Other Decks in Technology
See All in Technology
これからクラウドエンジニアになるために本当に必要なスキル 5選
hiyanger
1
460
問題解決に役立つ数理工学
recruitengineers
PRO
5
240
みんなで育てるNewsPicksのSLO
troter
4
1.1k
Redefine_Possible
upsider_tech
0
200
日本MySQLユーザ会ができるまで / making MyNA
tmtms
1
280
DIってなんだか難しい? 依存という概念を「使う・使われる」 という言葉で整理しよう
akinoriakatsuka
1
760
ClineにNext.jsのプロジェクト改善をお願いしてみた / 20250321_reacttokyo_LT
optim
1
1.2k
Amazon EKS Auto ModeでKubernetesの運用をシンプルにする
sshota0809
0
100
ルートユーザーの活用と管理を徹底的に深掘る
yuobayashi
6
700
Dapr For Java Developers SouJava 25
salaboy
1
130
バックエンドエンジニアによるフロントエンドテスト拡充の具体的手法
kinosuke01
1
610
Why Go?
xpmatteo
0
130
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
55
9.3k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
2.9k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
45
9.5k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.7k
Six Lessons from altMBA
skipperchong
27
3.7k
GitHub's CSS Performance
jonrohan
1030
460k
A Philosophy of Restraint
colly
203
16k
YesSQL, Process and Tooling at Scale
rocio
172
14k
Build The Right Thing And Hit Your Dates
maggiecrowley
34
2.6k
Reflections from 52 weeks, 52 projects
jeffersonlam
349
20k
Scaling GitHub
holman
459
140k
BBQ
matthewcrist
88
9.5k
Transcript
Prepared Router
Process of Build 1. Lexer Path 2. Generate Conditions 3.
Rollup and Optimize 4. Dynamic Prediction
1. Lexer Path /book/:id /book/:id/:page{\\d+} /search/* separator static dynamic regex
wildcard analyze the routing path 2. Generate Conditions pathParts is an array separated by separators. pathParts[1] = ‘book’ !!pathParts[2] ... /\d+/.test(pathParts[3]) ... pathParts.length > 2 ... And generate params
3. Rollup and Optimize if (A) { if (B) {
... } } if (C) { if (A) { ... } } optimize conditions if (A) { if (B) { ... } if (C) { ... } } if B and C are exclusive (B⊕C) if (A) { if (B) { ... }else if (C) { ... } }
4. Dynamic Prediction cache static path POST /books/list This is
static path Routing with built matcher and cache the results const results = matcher(“POST”, “/books/list”, ...) // [/books/*, /books/list] cache(“POST”, “/books/list”, results)