take out the rb gc for now, until I can merge in Lourens' stuff, and also add a test for multiple queries

This commit is contained in:
Roger Pack 2009-01-08 06:30:24 +00:00
parent 9d88487022
commit 98373d7b15
2 changed files with 13 additions and 0 deletions

View File

@ -190,8 +190,10 @@ static VALUE mysqlres2obj(MYSQL_RES* res)
resp->res = res;
resp->freed = Qfalse;
rb_obj_call_init(obj, 0, NULL);
/* disabled until it can be reviewed further--rely on the normal GC for now.
if (++store_result_count > GC_STORE_RESULT_LIMIT)
rb_gc();
*/
return obj;
}

View File

@ -0,0 +1,11 @@
# shows the effect of using .all_hashes instead of looping on each hash
# run it by substiting in a 'long' [many row] query for the query variable and toggling use_all_hashes here at the top
# note that we load all the rows first, then run .all_hashes on the result [to see more easily the effect of all hashes]
# on my machine and a 200_000 row table, it took 3.38s versus 3.65s
require 'rubygems'
require 'mysqlplus'
a = Mysql.real_connect('localhost','root')
100.times { a.query("select sleep(0)") }
print "pass"