turn off debug symbols again, put back benchmark script

This commit is contained in:
Brian Lopez 2010-03-31 08:56:07 -07:00
parent ae5a028189
commit 7e64570770
2 changed files with 21 additions and 33 deletions

View File

@ -1,48 +1,36 @@
# encoding: UTF-8
require 'rubygems'
require 'memprof'
# require 'benchmark'
# require 'mysql'
require 'benchmark'
require 'mysql'
require 'mysql2_ext'
number_of = 1
database = 'nbb_1_production'
sql = "SELECT * FROM account_transactions"
# Benchmark.bmbm do |x|
Memprof.start
# mysql = Mysql.new("localhost", "root")
# mysql.query "USE #{database}"
# x.report do
# puts "Mysql"
# number_of.times do
# mysql_result = mysql.query sql
# number = 0
# mysql_result.each_hash do |res|
# number += 1
Benchmark.bmbm do |x|
mysql = Mysql.new("localhost", "root")
mysql.query "USE #{database}"
x.report do
puts "Mysql"
number_of.times do
mysql_result = mysql.query sql
mysql_result.each_hash do |res|
# puts res.inspect
# end
# Memprof.stats
# Memprof.stop
# puts "Processed #{number} results"
# end
# end
end
end
end
mysql2 = Mysql2::Client.new
mysql2.query "USE #{database}"
# x.report do
# puts "Mysql2"
# number_of.times do
x.report do
puts "Mysql2"
number_of.times do
mysql2_result = mysql2.query sql
# # number = 0
mysql2_result.each(:symbolize_keys => true) do |res|
# # number += 1
# # puts res.inspect
# puts res.inspect
end
# # puts "Processed #{number} results"
# end
# end
Memprof.stats
Memprof.stop
# end
end
end
end

View File

@ -6,7 +6,7 @@ dir_config('mysql')
have_header('mysql/mysql.h')
$CFLAGS << ' -Wall -Wextra -funroll-loops'
$CFLAGS << ' -O0 -ggdb3'
# $CFLAGS << ' -O0 -ggdb3'
if have_library('mysqlclient')
if RUBY_VERSION =~ /1.9/