Skip to content

Instantly share code, notes, and snippets.

@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
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

@hellerbarde
hellerbarde / ipython
Created October 6, 2014 14:21
Demo of the dis module
In [1]: import dis
In [2]: def foo(what):
...: a = []
...: a = a+4
...: print a[0]
...: b = what[1:4]
...: print b[-1]
...:
@hellerbarde
hellerbarde / shell_aliases
Created November 18, 2015 12:36
Shell Aliases
# Be nice to your computer
alias please='sudo'
alias plz='sudo'
# file managing stuff
alias r="PYTHONOPTIMIZE=1 /usr/bin/ranger"
alias l='ls'
alias perm='stat -c %a'
# Dogit
so ~/.vim/sensible.vim
"dein Scripts-----------------------------
if &compatible
set nocompatible " Be iMproved
endif
" Required:
set runtimepath+=/Users/phil/.vim/dein.vim
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[dvipsnames]{xcolor}
\colorlet{LightRubineRed}{RubineRed!70!}
\colorlet{Mycolor1}{green!10!orange!90!}
\definecolor{Mycolor2}{HTML}{00F9DE}
\definecolor{matrixcolor}{HTML}{FF0000}