Sha256: 577784e476f54c62d855f6772b202cce8fa04f01dc20662014366672bf26f27e

Contents?: true

Size: 900 Bytes

Versions: 16

Compression:

Stored size: 900 Bytes

Contents

# encoding: UTF-8
$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/../lib')

require 'rubygems'
require 'benchmark'
require 'sequel'
require 'sequel/adapters/do'

number_of = 10
mysql2_opts = "mysql2://localhost/test"
mysql_opts = "mysql://localhost/test"
do_mysql_opts = "do:mysql://localhost/test"

class Mysql2Model < Sequel::Model(Sequel.connect(mysql2_opts)[:mysql2_test]); end
class MysqlModel < Sequel::Model(Sequel.connect(mysql_opts)[:mysql2_test]); end
class DOMysqlModel < Sequel::Model(Sequel.connect(do_mysql_opts)[:mysql2_test]); end

Benchmark.bmbm do |x|
  x.report do
    puts "Mysql2"
    number_of.times do
      Mysql2Model.limit(1000).all
    end
  end

  x.report do
    puts "do:mysql"
    number_of.times do
      DOMysqlModel.limit(1000).all
    end
  end

  x.report do
    puts "Mysql"
    number_of.times do
      MysqlModel.limit(1000).all
    end
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
ghazel-mysql2-0.2.6.3 benchmark/sequel.rb
ghazel-mysql2-0.2.6.2 benchmark/sequel.rb
ghazel-mysql2-0.2.6.1 benchmark/sequel.rb
mysql2-0.2.6 benchmark/sequel.rb
mysql2-0.2.6-x86-mswin32-60 benchmark/sequel.rb
mysql2-0.2.6-x86-mingw32 benchmark/sequel.rb
mysql2-0.2.5 benchmark/sequel.rb
mysql2-0.2.4 benchmark/sequel.rb
mysql2-0.2.3 benchmark/sequel.rb
mysql2-0.2.2 benchmark/sequel.rb
mysql2-0.2.1 benchmark/sequel.rb
mysql2-0.2.0 benchmark/sequel.rb
mysql2-0.1.9 benchmark/sequel.rb
mysql2-0.1.7 benchmark/sequel.rb
mysql2-0.1.6 benchmark/sequel.rb
mysql2-0.1.5 benchmark/sequel.rb