Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
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
700
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
71
Coercion in Ruby
arnvald
1
140
Writing config files in Ruby
arnvald
0
120
Speaking at RDRC
arnvald
0
130
Read more
arnvald
2
89
The simplest gem you'll ever use
arnvald
0
91
International to global
arnvald
0
84
Patterns, patterns everywhere
arnvald
0
110
Nomadic programmer - Baruco 2014 edition
arnvald
0
130
Other Decks in Programming
See All in Programming
「コードは上から下へ読むのが一番」と思った時に、思い出してほしい話
panda728
PRO
37
23k
Microservices Platforms: When Team Topologies Meets Microservices Patterns
cer
PRO
1
960
手が足りない!兼業データエンジニアに必要だったアーキテクチャと立ち回り
zinkosuke
0
510
[SF Ruby Conf 2025] Rails X
palkan
0
470
スタートアップを支える技術戦略と組織づくり
pospome
8
15k
DSPy Meetup Tokyo #1 - はじめてのDSPy
masahiro_nishimi
1
150
CSC509 Lecture 14
javiergs
PRO
0
220
Level up your Gemini CLI - D&D Style!
palladius
1
180
なあ兄弟、 余白の意味を考えてから UI実装してくれ!
ktcryomm
10
11k
[堅牢.py #1] テストを書かない研究者に送る、最初にテストを書く実験コード入門 / Let's start your ML project by writing tests
shunk031
12
7k
Navigation 3: 적응형 UI를 위한 앱 탐색
fornewid
1
190
AIコーディングエージェント(skywork)
kondai24
0
130
Featured
See All Featured
We Have a Design System, Now What?
morganepeng
54
7.9k
How to train your dragon (web standard)
notwaldorf
97
6.4k
Building Flexible Design Systems
yeseniaperezcruz
329
39k
GitHub's CSS Performance
jonrohan
1032
470k
Navigating Team Friction
lara
191
16k
BBQ
matthewcrist
89
9.9k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
Scaling GitHub
holman
464
140k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.6k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
380
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.5k
Build The Right Thing And Hit Your Dates
maggiecrowley
38
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