Skip to content

Instantly share code, notes, and snippets.

jboner / latency.txt
Last active May 14, 2021
Latency Numbers Every Programmer Should Know
View latency.txt
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
burke /
Created Jan 27, 2012 — forked from funny-falcon/cumulative_performance.patch
ruby-1.9.3-p327 cumulative performance patch for rbenv

ruby-1.9.3-p327 cumulative performance patch for rbenv

This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.


You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf using homebrew.

taf2 / load.patch
Created Jun 5, 2011
Ruby 1.9.2-p180 require performance patch
View load.patch
--- a/load.c 2010-10-23 05:36:38.000000000 -0400
+++ b/patchload.c 2011-06-05 08:58:00.000000000 -0400
@@ -40,14 +40,6 @@
VALUE ary;
long i;
- for (i = 0; i < RARRAY_LEN(load_path); ++i) {
- VALUE str = rb_check_string_type(RARRAY_PTR(load_path)[i]);
- if (NIL_P(str) || !rb_is_absolute_path(RSTRING_PTR(str)))
- goto relative_path_found;
mikhailov /
Created Nov 23, 2010
nginx+passenger (real production config)
# NOTICE: to get Nginx+Unicorn best-practices configuration see the gist
$ cd /usr/src
$ wget
$ tar xzvf ./nginx-1.2.1.tar.gz && rm -f ./nginx-1.2.1.tar.gz
$ wget
$ tar xzvf pcre-8.30.tar.gz && rm -f ./pcre-8.30.tar.gz
$ wget
dolzenko / verbose_deprecations.rb
Created Nov 8, 2010
Make deprecation messages dump full stack trace
View verbose_deprecations.rb
module ActiveSupport
module Deprecation
class << self
def deprecation_caller_message(callstack)
"(called from #{callstack.inspect})"