Name | Nanoseconds |
L1 cache reference | 0.5 |
Branch mispredict | 5.0 |
L2 cache reference | 7.0 |
Mutex lock/unlock | 100.0 |
Main memory reference | 100.0 |
Compress 1K bytes with Zippy | 10,000.0 |
Send 2K bytes over 1 Gbps network | 20,000.0 |
Read 1 MB sequentially from memory | 250,000.0 |
Round trip within same datacenter | 500,000.0 |
Rusty disk seek | 10,000,000.0 |
Read 1 MB sequentially from network | 10,000,000.0 |
Read 1 MB sequentially from disk | 30,000,000.0 |
Send packet from CA->Netherlands->CA | 150,000,000.0 |
From always excellent kellabyte.
Great numbers.
ReplyDeleteBut will depend highly about the hardware it runs on. For instance, Mutex lock/unlock will depend on what multi-thread is implemented, how many cores are sharing some data in their cache, and so on...
But as order of magnitudes, it is a pretty good approach.
Yes, I'm pretty sure that mutex lock/unlock is much more expensive on a Wintel platform.
DeleteThose mutex costs could match a critical section in Windows in low contention scenarios. Maybe that's what was meant rather than a Windows mutex object?
DeleteThe only number you should keep in mind is 42.
ReplyDeleteEspecially today :)
Deletebut what was the question?
Delete:)