Skip to content

Instantly share code, notes, and snippets.

View funny-falcon's full-sized avatar

Sokolov Yura funny-falcon

View GitHub Profile
@dolzenko
dolzenko / verbose_deprecations.rb
Created November 8, 2010 17:58
Make deprecation messages dump full stack trace
module ActiveSupport
module Deprecation
class << self
private
def deprecation_caller_message(callstack)
"(called from #{callstack.inspect})"
end
end
end
end
@mikhailov
mikhailov / installation.sh
Created November 23, 2010 15:18
nginx+passenger (real production config)
# NOTICE: to get Nginx+Unicorn best-practices configuration see the gist https://gist.github.com/3052776
$ cd /usr/src
$ wget http://nginx.org/download/nginx-1.2.1.tar.gz
$ tar xzvf ./nginx-1.2.1.tar.gz && rm -f ./nginx-1.2.1.tar.gz
$ wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.30.tar.gz
$ tar xzvf pcre-8.30.tar.gz && rm -f ./pcre-8.30.tar.gz
$ wget http://www.openssl.org/source/openssl-1.0.1c.tar.gz
@taf2
taf2 / load.patch
Created June 5, 2011 13:05
Ruby 1.9.2-p180 require performance 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;
@burke
burke / 0-readme.md
Created January 27, 2012 13:44 — 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.

Requirements

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.

@yohhoy
yohhoy / threads.h
Last active December 6, 2023 00:35
C11 <threads.h> emulation library
/*
* C11 <threads.h> emulation library
*
* (C) Copyright yohhoy 2012.
* Distributed under the Boost Software License, Version 1.0.
* (See copy at http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef EMULATED_THREADS_H_INCLUDED_
#define EMULATED_THREADS_H_INCLUDED_
@jboner
jboner / latency.txt
Last active April 26, 2024 03:40
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