Skip to content

Instantly share code, notes, and snippets.

@jeffchan
jeffchan / latency.txt
Created January 22, 2018 07:24 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
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
@jeffchan
jeffchan / gist:10808805
Created April 16, 2014 04:55
upgrade-timelib-5.6
root@li687-30:~/dev/hhvm# hphp/test/run -l hphp/test/quick hphp/test/slow hphp/test/zend/good/
Running 10277 tests in 9 threads
FAILED: hphp/test/slow/ext_datetime/strftime.php
--- hphp/test/slow/ext_datetime/strftime.php.expect-trimmed 2014-04-16 04:27:32.000000000 +0000
+++ hphp/test/slow/ext_datetime/strftime.php.out 2014-04-16 04:27:32.000000000 +0000
@@ -1,5 +1,4 @@
string(9) "Wednesday"
-string(20) " in German Mittwoch."
string(12) "52,2002,2002"
@jeffchan
jeffchan / gist:6115557
Created July 30, 2013 18:36
Get unique commits for a branch diff against master
g rev-list master..library-update --no-merges --pretty=format:'%h -%d %s %cr <%an>' --abbrev-commit --date=relative
@jeffchan
jeffchan / explore_spec.rb
Created July 2, 2013 14:49
Explore page rspec
require 'spec_helper'
describe 'Explore page' do
let(:book) { factory_stubbed_book('Metamorphosis', 'Franz Kafka') }
before do
PopularBooks.stub(:random => [book])
end
describe 'book listing' do