Latency numbers every programmer should know
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs
Round trip within same datacenter ...... 500,000 ns = 0.5 ms
Read 1 MB sequentially from SSD* ..... 1,000,000 ns = 1 ms
Disk seek ........................... 10,000,000 ns = 10 ms
Read 1 MB sequentially from disk .... 20,000,000 ns = 20 ms
Send packet CA->Netherlands->CA .... 150,000,000 ns = 150 ms
https://gist.github.com/hellerbarde/2843375
Здравствуйте, c-smile, Вы писали:
CS>Latency numbers every programmer should know
CS>CS>L1 cache reference ......................... 0.5 ns
CS>Branch mispredict ............................ 5 ns
CS>L2 cache reference ........................... 7 ns
CS>Mutex lock/unlock ........................... 25 ns
CS>Main memory reference ...................... 100 ns
CS>Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
CS>Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
CS>SSD random read ........................ 150,000 ns = 150 µs
CS>Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs
CS>Round trip within same datacenter ...... 500,000 ns = 0.5 ms
CS>Read 1 MB sequentially from SSD* ..... 1,000,000 ns = 1 ms
CS>Disk seek ........................... 10,000,000 ns = 10 ms
CS>Read 1 MB sequentially from disk .... 20,000,000 ns = 20 ms
CS>Send packet CA->Netherlands->CA .... 150,000,000 ns = 150 ms
CS>
CS>https://gist.github.com/hellerbarde/2843375
Вот более интерактивный источник
http://people.eecs.berkeley.edu/~rcs/research/interactive_latency.html
Здравствуйте, c-smile, Вы писали:
CS>Latency numbers every programmer should know
[...]
Ещё статья с картинкой на такую же тему:
http://ithare.com/infographics-operation-costs-in-cpu-clock-cycles/
Здравствуйте, c-smile, Вы писали:
CS>Latency numbers every programmer should know
CS>CS>L1 cache reference ......................... 0.5 ns
CS>Branch mispredict ............................ 5 ns
CS>L2 cache reference ........................... 7 ns
CS>Mutex lock/unlock ........................... 25 ns
CS>Main memory reference ...................... 100 ns
CS>Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
CS>Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
CS>SSD random read ........................ 150,000 ns = 150 µs
CS>Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs
CS>Round trip within same datacenter ...... 500,000 ns = 0.5 ms
CS>Read 1 MB sequentially from SSD* ..... 1,000,000 ns = 1 ms
CS>Disk seek ........................... 10,000,000 ns = 10 ms
CS>Read 1 MB sequentially from disk .... 20,000,000 ns = 20 ms
CS>Send packet CA->Netherlands->CA .... 150,000,000 ns = 150 ms
CS>
CS>https://gist.github.com/hellerbarde/2843375
в дот нете развернуть порядок байт в 8-ми байтовом целом, на стеке в 10-20 раз быстрее чем в куче. что на арме в моно что на x64 в .net
куда смотреть в списке?
CS>Disk seek ........................... 10,000,000 ns = 10 ms
наивно. может быть и 10 секунд под нагрузкой.
> Round trip within same datacenter ...... 500,000 ns = 0.5 ms
неподтверждаю.
на амазоне например set на мастер и СРАЗУ get со слейва реплицироуемого занимают по 0,1 милисекунд. это как минимимум три раундтрипа между тремя компами плюс затраты апп-уровня. это про редис
Здравствуйте, c-smile, Вы писали:
CS>Latency numbers every programmer should know
CS>CS>L1 cache reference ......................... 0.5 ns
CS>Branch mispredict ............................ 5 ns
CS>L2 cache reference ........................... 7 ns
CS>Mutex lock/unlock ........................... 25 ns
CS>Main memory reference ...................... 100 ns
CS>Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
CS>Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
CS>SSD random read ........................ 150,000 ns = 150 µs
CS>Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs
CS>Round trip within same datacenter ...... 500,000 ns = 0.5 ms
CS>Read 1 MB sequentially from SSD* ..... 1,000,000 ns = 1 ms
CS>Disk seek ........................... 10,000,000 ns = 10 ms
CS>Read 1 MB sequentially from disk .... 20,000,000 ns = 20 ms
CS>Send packet CA->Netherlands->CA .... 150,000,000 ns = 150 ms
CS>
CS>https://gist.github.com/hellerbarde/2843375
Mutex lock/unlock ........................... 25 ns
А оно имеет смысл без тайминга critical section?