some notes about escape benchmark
This commit is contained in:
parent
677c309963
commit
0128ad0e13
@ -15,6 +15,8 @@ Benchmark.bmbm do |x|
|
|||||||
x.report do
|
x.report do
|
||||||
puts "Mysql"
|
puts "Mysql"
|
||||||
number_of.times do
|
number_of.times do
|
||||||
|
# NOTE: this uses mysql_escape_string in C
|
||||||
|
# which is *not* encoding aware
|
||||||
mysql.escape_string str
|
mysql.escape_string str
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -24,6 +26,8 @@ Benchmark.bmbm do |x|
|
|||||||
x.report do
|
x.report do
|
||||||
puts "Mysql2"
|
puts "Mysql2"
|
||||||
number_of.times do
|
number_of.times do
|
||||||
|
# NOTE: this uses mysql_real_escape_string in C
|
||||||
|
# which takes into account the encoding set on the connection
|
||||||
mysql2.escape str
|
mysql2.escape str
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user