I had create a sample test to try out rails performance on mysql
I had created one rake task to load a 79440 record (almost 3.84MB) into
mysql database (innodb) and another is a java version (JDBC), i found
that the performance is alomost the same if the table’s engine is
Innodb. (slow, is that anyway to improve the performance? )
since the table is only for read, so of cause MYISAM is more suitable.
so with the same code, but difference type of engine (now is MYISAM),
and the result i get look like this :
14 seconds - java
1 min 8 seconds - ruby on rails - directly execute sql statement.
more then 1 minutes - ruby on rails, which create a object, insert
obj.save! it, however, i got no patient to finish
is pretty slow.
all code is run in same machine (window XP, 1.73GHz intel) mysql version
5.0, ruby use “mysql” adapter, java use JDBC adapter.
all code is in attachement.
pre condition : mysql5 is install, jdbc driver install, java code point
instructions : create a rails project and unzip the zip file to the
lib/tasks directory. download and unzip the sample file to load into
same dir too. this sample can get from
- how can I tweak (or should i tweak) the performance of rails ?
- why the InnoDB is so slow (is that because of transaction overhead )
- is this a correct way to test performance ?
thank for help.