Skip to content

Instantly share code, notes, and snippets.

@giorgio-v
giorgio-v / latency.markdown
Created June 14, 2012 12:16 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know

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

@giorgio-v
giorgio-v / keybase.md
Created September 19, 2014 09:25
keybase.md

Keybase proof

I hereby claim:

  • I am giorgio-v on github.
  • I am giorgio_v (https://keybase.io/giorgio_v) on keybase.
  • I have a public key whose fingerprint is FEE8 4F97 0C4D D91C E6F1 0C3A ACCB E645 A913 ADED

To claim this, I am signing this object:

@giorgio-v
giorgio-v / gist:1bc71ccd7ecc6c907c0c
Last active August 29, 2015 14:07 — forked from aphyr/gist:aa3de337d12ac886eb96
Functional clojure.test
(require '[clojure.test :as test])
; Rewrite clojure.test to generate data structures instead of writing to
; stdout
(def ^:dynamic *results*
"Bound dynamically to an atom wrapping a vector of test report maps")
(defn add-name
"Given a testing report map, assoc's on a :name derived from the current
`clojure.test/testing` context."