Skip to content

Instantly share code, notes, and snippets.

@gdi
gdi / Some benchmark results
Created June 25, 2009 12:48
The script that produced these results is here: http://gist.github.com/135854
Benchmarking ttserver with 2888750 email records
Indexing... this might take a long time...
Tokyo Tyrant Socket / Indexes
user system total real
find list by pk (n=40) 0.010000 0.000000 0.010000 ( 0.011436)
find record by pk 0.000000 0.000000 0.000000 ( 0.000390)
find by message_id 0.000000 0.000000 0.000000 ( 31.193551)
#!/usr/bin/env ruby
# Sample output is http://gist.github.com/135851
# Script to benchmark Message Meta Tokyo Tables
require 'rubygems'
require 'benchmark'
require 'date'
require 'fileutils'
require 'rufus/edo'
require 'rufus/tokyo/tyrant'
There is a spreadsheet of a bigger comparo here: http://spreadsheets.google.com/pub?key=rWBwk7nwt6RKn0zyq6RrCDA&output=html
Benchmarking ttserver with 2888750 email records
!!! Correction: pk_only queries had bad times in the earlier revision
!!! "Tuned Indexes" means I manually set the bnum to 2x the key count; all indices are set to "large"
Tokyo Tyrant Socket / No Indexes / Untuned Queries
user system total real
find record by pk 0.000000 0.000000 0.000000 ( 0.000592)
#!/usr/bin/env ruby
# Script to benchmark mysql equivalents of the Tokyo Table Queries
require 'rubygems'
require 'mysql'
require 'benchmark'
puts "Benchmarking mysql with 2888750 email records"
Script lives here: http://gist.github.com/138318
There is a spreadsheet of a bigger comparo here: http://spreadsheets.google.com/pub?key=rWBwk7nwt6RKn0zyq6RrCDA&output=html
Benchmarking mysql with 2888750 email records
MySQL ISAM / MySQL-Ruby / Indexed / Untuned
user system total real
find record by pk 0.000000 0.000000 0.000000 ( 0.000489)
# Rake task for listing all Cucumber steps defined
namespace :cucumber do
task :steps do
list = { :given => [], :when => [], :then => [] }
files = Dir.glob(File.join(File.dirname(__FILE__),'features','**','*.rb')).each do |f|
File.readlines(f).select { |l| l =~ /\s*[^#]?\s*(Given|When|Then)\s\// }.each do |line|
line =~ /(Given|When|Then)\s+(\/\^?)?([^$\/]+)(\$?\/)?/
type = $1.downcase.to_sym
name = "#{$1} #{$3}".strip
@gdi
gdi / sr
Created December 8, 2009 15:30
#!/bin/sh
ssh root@$1
@gdi
gdi / gits
Created December 8, 2009 15:31
#!/bin/sh
git status
# mongo_template.rb
# remove unneeded defaults
run "rm public/index.html"
run "rm public/images/rails.png"
run "rm public/javascripts/controls.js"
run "rm public/javascripts/dragdrop.js"
run "rm public/javascripts/effects.js"
run "rm public/javascripts/prototype.js"
$ scp root@myserver:/etc/chef/webui.pem /tmp/webui.pem
webui.pem 100% 1675 1.6KB/s 00:00
$ scp root@myserver:/etc/chef/validation.pem /tmp/validation.pem
validation.pem 100% 1679 1.6KB/s 00:00
$ knife configure -i
Where should I put the config file? [~/.chef/knife.rb] ~/.chef/staging_knife.rb
Please enter the chef server URL: [http://localhost:4000] http://myserver:4000
Please enter a clientname for the new client: [drat]