Skip to content

Instantly share code, notes, and snippets.

@jeffchan
jeffchan / latency.txt
Created Jan 22, 2018 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
View latency.txt
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 Apr 16, 2014
upgrade-timelib-5.6
View gist:10808805
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 Jul 30, 2013
Get unique commits for a branch diff against master
View gist:6115557
g rev-list master..library-update --no-merges --pretty=format:'%h -%d %s %cr <%an>' --abbrev-commit --date=relative
View explore_spec.rb
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
You can’t perform that action at this time.