Skip to content

Instantly share code, notes, and snippets.

View 0xcpu's full-sized avatar
💭
I do nothing every day

panda bear 0xcpu

💭
I do nothing every day
View GitHub Profile
@sbp
sbp / png.py
Created July 10, 2012 16:49
Simple PNG parser
#!/usr/bin/env python
import sys, struct, binascii
def header(bytes):
return struct.unpack('>NNccccc', bytes)
def parse(bytes):
signature = bytes[:8]
bytes = bytes[8:]
@djcsdy
djcsdy / LICENSE.txt
Created June 5, 2012 15:04 — forked from p01/LICENSE.txt
Music SoftSynth
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Mathieu 'p01' Henri http://www.p01.org/releases/
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@jboner
jboner / latency.txt
Last active April 27, 2025 10:07
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD