Skip to content

Instantly share code, notes, and snippets.

@brow
brow / gist:1562617
Created January 4, 2012 22:44
Benchmark concatenating strings with reduce(:+) vs. with join('').
require 'benchmark'
STRING = 'abc'
ITERATIONS = 500000
Benchmark.bm do |bench|
for n in [2,3,4]
n_strings = Array.new(n, STRING)
bench.report("add #{n}") do
@brow
brow / redis.markdown
Created October 26, 2011 10:13 — forked from bdotdub/redis.markdown
Running redis using upstart on Ubuntu

Running redis using upstart on Ubuntu

I've been trying to understand how to setup systems from the ground up on Ubuntu. I just installed redis onto the box and here's how I did it and some things to look out for.

To install: