-
-
Save nateberkopec/03cdbe26578fe1d1add2db7f4867ec38 to your computer and use it in GitHub Desktop.
Ruby on Rails latency chart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Latency Comparison Numbers (~2024, compiled by www.speedshop.co) | |
---------------------------------- | |
local variable or CONSTANT access 50 ns | |
thread variable access 75 ns | |
Logger.info('string') 1,000 ns 1 us | |
Parse 1kb JSON 25,000 ns 25 us | |
Thread.new 40,000 ns 40 us | |
User.find(1) (cold, sqlite3) 100,000 ns 100 us | |
Allocate 10,000 objects 250,000 ns 250 us | |
AR Querycache HIT, postgres 250,000 ns 250 us | |
Rails.cache.fetch(str key, 1kb val) 500,000 ns 500 us | |
User.find(1) (cold, pg) 1,000,000 ns 1,000 us 1 ms | |
`echo 'shelling out'` 5,000,000 ns 5,000 us 5 ms | |
Allocate 1 million objects 30,000,000 ns 30,000 us 30 ms | |
p50 Rails response 75,000,000 ns 75,000 us 75 ms | |
react route change (w/o fetch) 100,000,000 ns 100,000 us 100 ms | |
elasticsearch query 200,000,000 ns 200,000 us 200 ms | |
call to 3rd party HTTP API 250,000,000 ns 250,000 us 250 ms | |
react route change (w/fetch) 500,000,000 ns 500,000 us 500 ms | |
download + compile SPA (small) 1,000,000,000 ns 1,000,000 us 1000 ms | |
typical Largest Contentful Paint 2,000,000,000 ns 2,000,000 us 2000 ms | |
Notes | |
----- | |
1 ns = 10^-9 seconds | |
1 us = 10^-6 seconds = 1,000 ns | |
1 ms = 10^-3 seconds = 1,000 us = 1,000,000 ns | |
Credit | |
------ | |
By jboner: https://gist.github.com/jboner/2841832 | |
By Jeff Dean: http://research.google.com/people/jeff/ | |
Originally by Peter Norvig: http://norvig.com/21-days.html#answers |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment