Skip to content

Instantly share code, notes, and snippets.

View chucknthem's full-sized avatar

Charles Ma chucknthem

View GitHub Profile
@jboner
jboner / latency.txt
Last active May 18, 2025 19:02
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
@treyharris
treyharris / git-ident.md
Last active February 11, 2021 14:22
Why ident attribute doesn't work in Git like CSV/SVN

Why the ident attribute doesn't work in Git like in CVS or SVN

This is a wrinkle that people often don't get about the ident attribute: in CVS or Subversion, it would be legitimate to have a VERSION file containing nothing but $Id$ as a way of tracking that the right push had happened; if you did that with git, you'd get nothing useful. If you run the script below (or just read it and the output that follows), you can see why.

(Please direct comments on this to https://plus.google.com/+TreyHarris/posts/KRgNG3zDk9x.)

How do you do it?

Setting it up in Git is relatively simple. You create (or edit) the file .gitattributes and add a line telling Git to replace $Id$ when found in files that match certain filenames: