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
Your API is too slow!
Search
Grzegorz Witek
June 23, 2016
Programming
0
710
Your API is too slow!
RedDotRubyConf 2016
Grzegorz Witek
June 23, 2016
Tweet
Share
More Decks by Grzegorz Witek
See All by Grzegorz Witek
One Year with Hanami
arnvald
0
78
Coercion in Ruby
arnvald
1
150
Writing config files in Ruby
arnvald
0
130
Speaking at RDRC
arnvald
0
140
Read more
arnvald
2
95
The simplest gem you'll ever use
arnvald
0
100
International to global
arnvald
0
100
Patterns, patterns everywhere
arnvald
0
130
Nomadic programmer - Baruco 2014 edition
arnvald
0
130
Other Decks in Programming
See All in Programming
Smart Handoff/Pickup ガイド - Claude Code セッション管理
yukiigarashi
0
130
フルサイクルエンジニアリングをAI Agentで全自動化したい 〜構想と現在地〜
kamina_zzz
0
400
izumin5210のプロポーザルのネタ探し #tskaigi_msup
izumin5210
1
110
AI時代の認知負荷との向き合い方
optfit
0
160
HTTPプロトコル正しく理解していますか? 〜かわいい猫と共に学ぼう。ฅ^•ω•^ฅ ニャ〜
hekuchan
2
690
CSC307 Lecture 01
javiergs
PRO
0
690
生成AIを使ったコードレビューで定性的に品質カバー
chiilog
1
270
15年続くIoTサービスのSREエンジニアが挑む分散トレーシング導入
melonps
2
200
React 19でつくる「気持ちいいUI」- 楽観的UIのすすめ
himorishige
11
7.4k
CSC307 Lecture 08
javiergs
PRO
0
670
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
460
CSC307 Lecture 02
javiergs
PRO
1
780
Featured
See All Featured
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
64
Leo the Paperboy
mayatellez
4
1.4k
Ruling the World: When Life Gets Gamed
codingconduct
0
140
Darren the Foodie - Storyboard
khoart
PRO
2
2.4k
Being A Developer After 40
akosma
91
590k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.2k
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
91
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
0
200
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.1k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
580
RailsConf 2023
tenderlove
30
1.3k
Transcript
@arnvald, RedDotRubyConf 2016 YOUR API IS TOO SLOW!
None
@arnvald, RedDotRubyConf 2016 YOUR API IS TOO SLOW!
@arnvald, RedDotRubyConf 2016 YOUR API IS TOO SLOW! 2TQDCDN[ HCUVGPQWIJ
Grzegorz Witek
is speed a feature?
is lack of speed a bug?
Algolia Github
Web application optimization loading priority static content dynamic content domain
sharing JavaScript compression asset minifying CSS HTML un-CSS prefetching HTTP/2 image sprites CDN database optimization multi-threading
Web API optimization loading priority static content dynamic content domain
sharing JavaScript compression asset minifying CSS HTML un-CSS prefetching HTTP/2 image sprites CDN database optimization multi-threading
Long way of a request ! " #
Latency ! " #
Where are your users? "
Where are your users? " Singapore Jakarta 13ms
Where are your users? " Singapore Hanoi 100ms
Where are your users? " Singapore New York 265ms
Where are your users? " Singapore Shanghai 320ms
Dynamic content acceleration ! CDN #
Latency
Latency
Long way of a request ! " #
Processing #
Don’t be a smart-ass “Oh, I know, we have to
cache it!”
Measure gem 'ruby-prof' gem 'rack-mini-profiler'
Measure in production mode pre-production stage
Measure gem 'newrelic' gem 'skylight'
Measure profile - focus on the slowest part
Measure benchmark - compare alternative solutions
Improve
Improve Rely on your database
Improve Where is your cache?
Improve Redis on a separate machine - fast Redis on
the same machine - faster Application memory - the fastest
Improve Multi-layered cache (Russian doll caching)
Improve When needed - mutate
Improve Upgrade your libraries
Improve When needed - replace your libraries
Improve gem 'json' gem 'oj' gem 'oj-mimic-json'
Improve Native extensions - not only C!
Improve https://github.com/rustbridge/helix https://github.com/d-unseductable/ruru
Improve Move processing to the background
Improve When desperate - extract part of the application
Improve I said "when desperate" not "ASAP NOW!!!11"
Improve I said "part", not "rewrite everything in Go"
Improve There's more, way more
Long way of a request ! " #
Download ! " #
Improve Not only GZIP
Long way of a request ! " #
Speed up your API use CDN infrastructure profile and benchmark
focus on the slowest part rewriting is the last thing to consider
Speed up your API Ruby is fast enough Sinatra is
fast enough Rails is fast enough
@arnvald, RedDotRubyConf 2016 YOUR API IS TOO SLOW! 2TQDCDN[ HCUVGPQWIJ