Created
October 21, 2010 19:41
-
-
Save ebryn/639168 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'bench_press' | |
# begin gem 'odbc', '0.99992' ; rescue Gem::LoadError ; end | |
require 'odbc' | |
$:.unshift File.expand_path('../../../lib',__FILE__) | |
require 'tiny_tds' | |
extend BenchPress | |
author 'Erik Bryn' | |
summary 'Benchmarking comparison between TinyTds and Ruby-ODBC' | |
reps 1_000 | |
$query_all = "SELECT * FROM [datatypes]" | |
measure "Ruby-ODBC" do | |
client = ODBC.connect 'tinytds', 'tinytds', '' | |
client.use_time = true | |
h = client.run($query_all) | |
h.fetch_all | |
h.drop | |
end | |
measure "TinyTds" do | |
client = TinyTds::Client.new({ | |
:host => ENV['TINYTDS_UNIT_HOST'] || 'local', | |
:username => 'tinytds', | |
:password => '', | |
:database => 'tinytds_test', | |
:appname => 'TinyTds Dev', | |
:login_timeout => 5, | |
:timeout => 5 | |
}) | |
client.execute($query_all).each | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment