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
Strike - Yet Another Fast PHP Router -
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
gourrymk2
July 31, 2014
Programming
170
3
Share
Strike - Yet Another Fast PHP Router -
gourrymk2
July 31, 2014
Other Decks in Programming
See All in Programming
実践ハーネスエンジニアリング:ステアリングループを実例から読み解く / Practical Harness Engineering: Understanding Steering Loops Through Real-World Examples
nrslib
3
2.7k
Oxlintとeslint-plugin-react-hooks 明日から始められそう?
t6adev
0
320
Road to RubyKaigi: Play Hard(ware)
makicamel
1
540
書籍「ユーザーストーリーマッピング」が私のバイブル
asumikam
4
480
Firefoxにコントリビューションして得られた学び
ken7253
2
150
GitHubCopilotCLIをはじめよう.pdf
htkym
0
320
Spec Driven Development | AI Summit Vilnius
danielsogl
PRO
1
140
CursorとClaudeCodeとCodexとOpenCodeを実際に比較してみた
terisuke
1
520
Back to the roots of date
jinroq
0
690
Agent Skills を社内で育てる仕組み作り
jackchuka
1
1.3k
Cache-moi si tu peux : patterns et pièges du cache en production - Devoxx France 2026 - Conférence
slecache
0
330
Structured Concurrency, Scoped Values and Joiners in the JDK 25 26 27
josepaumard
1
140
Featured
See All Featured
How to Think Like a Performance Engineer
csswizardry
28
2.6k
The Curse of the Amulet
leimatthew05
1
12k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.4k
It's Worth the Effort
3n
188
29k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.7k
Designing for humans not robots
tammielis
254
26k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Color Theory Basics | Prateek | Gurzu
gurzu
0
300
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
160
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
110
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Transcript
Strike Yet Another Fast PHP Router By Leo
Leo 寸永來 Work at S.M.S. Taiwan 知恩思資訊股份有限公司 Senior PHP Developer
Joomla! 3 / Symfony2 / Doctrine2 / Silex / Node.js GitHub: https://github.com/LeoOnTheEarth
1. What is Strike? 2. How router works 3. Performance
What is Strike?
1. A pure router library (require zero dependency) 2. Easy
to use 3. Fast enough 4. https://github.com/LeoOnTheEarth/Strike What is Strike?
Install with composer Strike Installation
Route Collecting
Route Matching
Matched Route Format
Generate URL
StrikeAcceslerator Install with composer
StrikeAcceslerator Usage
StrikeAcceslerator Usage StrikeAccelerator with APC cache
How Router Works Collect Patterns ↓ Compile Patterns ↓ Match
Path
How Router Works Collect Patterns ↓ Compile Patterns ↓ Match
Path CACHE
How Pux Works
How Symfony Works
How Strike Works /blog/article/{id}/{title}
How Strike Works Pattern: /blog/article/{id}/{title} URL path: /blog/article/123/title-balabala
How Strike Works
How Strike Works
How Strike Works / /blog/article/{id}/{title} /blog/article/archives/{year}/{month}/{day} /blog/articles /news
More complex mapping
Optimized mapping (Will implement later) After I figured out this
implementation, I found it is similar to Symfony.
Performance Comparing Strike dev-master StrikeAccelerator dev-master Pux v1.5 Symfony2 v2.5.2
Benchmark Environment Linode instance • 2 GB RAM • 2
CPU Cores • SSD Storage • CentOS 6.5 • PHP 5.4.30 • Added 18 patterns Match pattern: “/blog/article/{id}/{title}” Match path: “/blog/article/345/router-benchmarks” Source code: https://github.com/LeoOnTheEarth/StrikeBenchmark
Benchmark Results Run 10000 times in console without cache (less
is better) Total Match 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 Strike Pux Symfony response time (ms)
Total Match 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35
0.4 0.45 0.5 Strike-cache Pux-cache Symfony-cache response time (ms) Benchmark Results Run 10000 times in console with cache (less is better)
Benchmark Results Apache Benchmark Test without cache (more is better)
ab -c 10 -n 100 ab -c 10 -n 500 ab -c 50 -n 500 ab -c 100 -n 500 0 100 200 300 400 500 600 700 Apache benchmark result (without cache) Strike Pux Symfony Requests per second
Benchmark Results Apache Benchmark Test with cache (more is better)
ab -c 10 -n 100 ab -c 10 -n 500 ab -c 50 -n 500 ab -c 100 -n 500 0 100 200 300 400 500 600 700 800 Apache benchmark result (with cache) Strike-cache Pux-cache Symfony-cache Requests per second
Benchmark Summary 1. Pux performance is quiet awesome. 2. Router
match is not a performance issue, it's fast enough 3. We should focus on the performance during router initialization
Strike will continue enhance it's performance Feel free to send
feedback on GitHub https://github.com/LeoOnTheEarth/Strike
Thanks For Your Listening Any Questions?