Skip to content

Instantly share code, notes, and snippets.

View ValerieAnne563's full-sized avatar
💫

Valerie Anne Houseman ValerieAnne563

💫
View GitHub Profile
@GLMeece
GLMeece / latency_numbers.md
Last active April 29, 2024 09:47
Latency Numbers Every Programmer Should Know - MarkDown Fork

Latency Comparison Numbers

Note: "Forked" from Latency Numbers Every Programmer Should Know

Event Nanoseconds Microseconds Milliseconds Comparison
L1 cache reference 0.5 - - -
Branch mispredict 5.0 - - -
L2 cache reference 7.0 - - 14x L1 cache
Mutex lock/unlock 25.0 - - -
@naiquevin
naiquevin / comp.py
Last active April 13, 2019 15:09
Function composition in Python inspired by Clojure's `comp` function
## Update! Found an alternative approach that's concise and feels much more idiomatic
def compose (f, g):
return lambda x: f(g(x))
def comp(*args):
return reduce(compose, args[1:], args[0])
def comp1(*args):