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
370
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
710
Programming flying robots with JavaScript
felixge
2
890
Programming flying robots with JavaScript
felixge
0
530
Programming an AR Drone Firmware with JS (de)
felixge
1
570
Faster than C?
felixge
1
1.2k
Flying robots over a 10.000 mile distance with JavaScript.
felixge
0
430
Faster than C?
felixge
1
560
The power of node.js (with quadcopters)
felixge
0
450
Faster than C?
felixge
0
360
Other Decks in Programming
See All in Programming
Modular Monolith Go Server with GraphQL Federation + gRPC
110y
1
590
Understand the mechanism! Let's do screenshots tests of Compose Previews with various variations / 仕組みから理解する!Composeプレビューを様々なバリエーションでスクリーンショットテストしよう
sumio
3
830
Jakarta EE meets AI
ivargrimstad
0
390
unique パッケージから学ぶ interning と weak reference @ Asakusa.go#3
karamaru
2
810
事業フェーズの変化に対応する 開発生産性向上のゼロイチ
masaygggg
0
200
What is Parser
yui_knk
9
4.1k
『ドメイン駆動設計をはじめよう』中核の業務領域
masuda220
PRO
5
1k
私のEbitengineの第一歩
qt_luigi
0
450
Rechartsで楽にゴリゴリにカスタマイズする!
10tera
1
170
いつか使える ObjectSpace / Maybe useful ObjectSpace
euglena1215
2
140
長期運用プロダクトの開発速度を維持し続けるためのリファクタリング実践例
wataruss
8
2.7k
REXML改善のその後
naitoh
0
190
Featured
See All Featured
Optimizing for Happiness
mojombo
375
69k
Designing with Data
zakiwarfel
98
5k
StorybookのUI Testing Handbookを読んだ
zakiyama
26
5.1k
We Have a Design System, Now What?
morganepeng
48
7.1k
Music & Morning Musume
bryan
46
6k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
23
1.7k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
1
55
Large-scale JavaScript Application Architecture
addyosmani
508
110k
The Illustrated Children's Guide to Kubernetes
chrisshort
47
48k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
45
4.8k
Into the Great Unknown - MozCon
thekraken
29
1.4k
The Invisible Customer
myddelton
119
13k
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