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
As fast as C?
Search
Felix Geisendörfer
June 27, 2012
Programming
0
380
As fast as C?
Talk given at the London Node.js User Group.
Felix Geisendörfer
June 27, 2012
Tweet
Share
More Decks by Felix Geisendörfer
See All by Felix Geisendörfer
tus.io - Resumable File Uploads (Lightning Talk)
felixge
2
730
Programming flying robots with JavaScript
felixge
2
910
Programming flying robots with JavaScript
felixge
0
550
Programming an AR Drone Firmware with JS (de)
felixge
1
580
Faster than C?
felixge
1
1.2k
Flying robots over a 10.000 mile distance with JavaScript.
felixge
0
450
Faster than C?
felixge
1
580
The power of node.js (with quadcopters)
felixge
0
460
Faster than C?
felixge
0
370
Other Decks in Programming
See All in Programming
HTTP compression in PHP and Symfony apps
dunglas
2
1.7k
KubeCon + CloudNativeCon NA 2024 Overviewat Kubernetes Meetup Tokyo #68 / amsy810_k8sjp68
masayaaoyama
0
250
ソフトウェアの振る舞いに着目し 複雑な要件の開発に立ち向かう
rickyban
0
890
Go の GC の不得意な部分を克服したい
taiyow
2
760
わたしの星のままで一番星になる ~ 出産を機にSIerからEC事業会社に転職した話 ~
kimura_m_29
0
180
「Chatwork」Android版アプリを 支える単体テストの現在
okuzawats
0
180
From Translations to Multi Dimension Entities
alexanderschranz
2
130
StarlingMonkeyを触ってみた話 - 2024冬
syumai
3
270
複雑な仕様に立ち向かうアーキテクチャ
myohei
0
170
fs2-io を試してたらバグを見つけて直した話
chencmd
0
220
17年周年のWebアプリケーションにTanStack Queryを導入する / Implementing TanStack Query in a 17th Anniversary Web Application
saitolume
0
250
MCP with Cloudflare Workers
yusukebe
2
220
Featured
See All Featured
Embracing the Ebb and Flow
colly
84
4.5k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
0
94
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
Why Our Code Smells
bkeepers
PRO
335
57k
How to Think Like a Performance Engineer
csswizardry
22
1.2k
Optimising Largest Contentful Paint
csswizardry
33
3k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
2
160
The Art of Programming - Codeland 2020
erikaheidi
53
13k
Making Projects Easy
brettharned
116
5.9k
Designing for humans not robots
tammielis
250
25k
Making the Leap to Tech Lead
cromwellryan
133
9k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Transcript
As fast as C? Writing high performance stream parsers in
JS. Felix Geisendörfer June 27, 2012 - London Node.js User Group
Thanks Forward!
Felix Geisendörfer
(@)felixge(.de)
core contributor
transloadit.com
~50 npm modules
node-formidable
node-mysql
Parser Geeks?
As fast as C?
Dubious Benchmarks Ahead!
Selecting 100k blog post rows
None
None
0 15000 30000 45000 60000 node-mysql-0.9.6 node-mysql-libmysqlclient-1.3.3 node-mysql-2.0.0-alpha3 53966 36429
20968 Rows per Second node-mysql-0.9.6 node-mysql-libmysqlclient-1.3.3 node-mysql-2.0.0-alpha3 https://github.com/felixge/mysql-client-benchmarks
0 17500 35000 52500 70000 node-mysql-0.9.6 node-mysql-libmysqlclient-1.3.3 node-mysql-2.0.0-alpha3 php-mysqlnd-5.13 68097
53966 36429 20968 Rows per Second node-mysql-0.9.6 node-mysql-libmysqlclient-1.3.3 node-mysql-2.0.0-alpha3 php-mysqlnd-5.13 https://github.com/felixge/mysql-client-benchmarks
Pure node.js parsers can compete with C Addons
Lessons Learned
Practice
Benchmark First
Buffering can be good!
Code!
it
Sponsors
They’re hiring! @dan_jenkins
Also hiring!
Questions? ” http://felixge.de/
[email protected]
@felixge
Algorithms
------------------------------4a62195680a6 Content-Disposition: form-data; name="upload1"; filename="file1.txt" Content-Type: text/plain file 1 data
... ------------------------------4a62195680a6 Content-Disposition: form-data; name="upload2"; filename="file2.txt" Content-Type: text/plain file 2 data ... ------------------------------4a62195680a6-- Example: Multipart (File Uploads)
Lots and lots of file data ... ------------------------------4a62195680a6 Naive Boundary
Search: One byte at a time