Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # encoding: UTF-8
- $LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/../lib')
- require 'rubygems'
- require 'benchmark'
- require 'sequel'
- number_of = 10
- mysql2_opts = {
- :adapter => 'mysql2',
- :database => 'test'
- }
- mysql_opts = {
- :adapter => 'mysql',
- :database => 'test'
- }
- class Mysql2Model < Sequel::Model(Sequel.connect(mysql2_opts)[:mysql2_test]); end
- class MysqlModel < Sequel::Model(Sequel.connect(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 "Mysql"
- number_of.times do
- MysqlModel.limit(1000).all
- end
- end
- end
Add Comment
Please, Sign In to add comment