Sha256: 1a2a3089e1bacae6166d1a715df926c51eb0587b28b0faa1a8cee975c046708d

Contents?: true

Size: 890 Bytes

Versions: 50

Compression:

Stored size: 890 Bytes

Contents

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

require 'rubygems'
require 'benchmark'
require 'mysql2'
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 "Mysql2" do
    number_of.times do
      Mysql2Model.limit(1000).all
    end
  end

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

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

Version data entries

50 entries across 50 versions & 6 rubygems

Version Path
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/mysql2-0.3.11/benchmark/sequel.rb
mysql2-0.2.19b4 benchmark/sequel.rb
mysql2-0.3.12b4 benchmark/sequel.rb
mysql2-0.2.19b3 benchmark/sequel.rb
mysql2-0.3.12b3 benchmark/sequel.rb
mysql2-0.3.12b2 benchmark/sequel.rb
mysql2-0.2.19b2 benchmark/sequel.rb
mysql2-0.3.12b1 benchmark/sequel.rb
mysql2-0.2.19b1 benchmark/sequel.rb
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/mysql2-0.3.11/benchmark/sequel.rb
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/mysql2-0.3.11/benchmark/sequel.rb
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/mysql2-0.3.11/benchmark/sequel.rb
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/mysql2-0.3.11/benchmark/sequel.rb
sunrise-cms-0.3.0.rc vendor/bundle/ruby/1.9.1/gems/mysql2-0.3.11/benchmark/sequel.rb
mysql2-sp-0.3.10 benchmark/sequel.rb
solaris-mysql2-0.3.11 benchmark/sequel.rb
mysql2-0.3.11-x86-mswin32-60 benchmark/sequel.rb
mysql2-0.3.11-x86-mingw32 benchmark/sequel.rb
mysql2-0.3.11 benchmark/sequel.rb
mysql2-0.2.18-x86-mswin32-60 benchmark/sequel.rb