Skip to content

Instantly share code, notes, and snippets.

# little test script to verify the speed of msgpack vs. json
require 'rubygems'
require 'yajl'
require 'msgpack'
require 'benchmark'
array = (1..20).map {|i| rand(i)}
map = (1..20).inject({}) {|r, o| r[rand(o).to_s] = rand(o); r}
string = (1..512).map {|i| ((rand(i) % 94) + 32).chr.to_s}.join('')
require 'rubygems'
require 'bert'
require 'json'
require 'yajl'
require 'benchmark'
ITER = 1_000
tiny = t[:ok, :awesome]
small = t[:ok, :answers, [42] * 42]