don't really need to specify a db for the escape benchmark
This commit is contained in:
parent
1c9e94f7e9
commit
737edcfe67
|
@ -7,12 +7,10 @@ require 'mysql2_ext'
|
||||||
require 'do_mysql'
|
require 'do_mysql'
|
||||||
|
|
||||||
number_of = 1000
|
number_of = 1000
|
||||||
database = 'nbb_1_production'
|
|
||||||
str = "abc'def\"ghi\0jkl%mno"
|
str = "abc'def\"ghi\0jkl%mno"
|
||||||
|
|
||||||
Benchmark.bmbm do |x|
|
Benchmark.bmbm do |x|
|
||||||
mysql = Mysql.new("localhost", "root")
|
mysql = Mysql.new("localhost", "root")
|
||||||
mysql.query "USE #{database}"
|
|
||||||
x.report do
|
x.report do
|
||||||
puts "Mysql"
|
puts "Mysql"
|
||||||
number_of.times do
|
number_of.times do
|
||||||
|
@ -21,7 +19,6 @@ Benchmark.bmbm do |x|
|
||||||
end
|
end
|
||||||
|
|
||||||
mysql2 = Mysql2::Client.new(:host => "localhost", :username => "root")
|
mysql2 = Mysql2::Client.new(:host => "localhost", :username => "root")
|
||||||
mysql2.query "USE #{database}"
|
|
||||||
x.report do
|
x.report do
|
||||||
puts "Mysql2"
|
puts "Mysql2"
|
||||||
number_of.times do
|
number_of.times do
|
||||||
|
@ -29,7 +26,7 @@ Benchmark.bmbm do |x|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
do_mysql = DataObjects::Connection.new("mysql://localhost/#{database}")
|
do_mysql = DataObjects::Connection.new("mysql://localhost/test")
|
||||||
x.report do
|
x.report do
|
||||||
puts "do_mysql"
|
puts "do_mysql"
|
||||||
number_of.times do
|
number_of.times do
|
||||||
|
|
Loading…
Reference in New Issue