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
720
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
80
Coercion in Ruby
arnvald
1
170
Writing config files in Ruby
arnvald
0
140
Speaking at RDRC
arnvald
0
150
Read more
arnvald
2
99
The simplest gem you'll ever use
arnvald
0
110
International to global
arnvald
0
110
Patterns, patterns everywhere
arnvald
0
130
Nomadic programmer - Baruco 2014 edition
arnvald
0
130
Other Decks in Programming
See All in Programming
RubyとGoでゼロから作る証券システム: 高信頼性が求められるシステムのコードの外側にある設計と運用のリアル
free_world21
0
140
AI時代でも変わらない技術コミュニティの力~10年続く“ゆるい”つながりが生み出す価値
n_takehata
2
560
AIによる開発の民主化を支える コンテキスト管理のこれまでとこれから
mulyu
3
2.2k
PostgreSQL を使った快適な go test 環境を求めて
otakakot
0
380
izumin5210のプロポーザルのネタ探し #tskaigi_msup
izumin5210
1
500
Premier Disciplin for Micro Frontends Multi Version/ Framework Scenarios @OOP 2026, Munic
manfredsteyer
PRO
0
200
AIエージェントのキホンから学ぶ「エージェンティックコーディング」実践入門
masahiro_nishimi
7
1.2k
Geminiの機能を調べ尽くしてみた
naruyoshimi
0
190
Raku Raku Notion 20260128
hareyakayuruyaka
0
430
AIコーディングの理想と現実 2026 | AI Coding: Expectations vs. Reality 2026
tomohisa
0
820
日本だけで解禁されているアプリ起動の方法
ryunakayama
0
360
Head of Engineeringが現場で回した生産性向上施策 2025→2026
gessy0129
0
200
Featured
See All Featured
Color Theory Basics | Prateek | Gurzu
gurzu
0
220
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
110
The agentic SEO stack - context over prompts
schlessera
0
670
Navigating Weather and Climate Data
rabernat
0
130
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.1k
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.3k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.1k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
660
Being A Developer After 40
akosma
91
590k
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