ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Butler <jeffgbut...@gmail.com>
Subject Re: Performance & SQL Formatting Issue
Date Wed, 04 Feb 2009 19:22:09 GMT
I duplicated this code but removed all the external dependencies
(Spring, DBCP, etc.).  I just stripped it down to plain iBATIS and
MySQL.

My results show this:

20000 Unformatted Inserts: 3 seconds Avg.
20000 Formatted Inserts: 2.5 seconds Avg.

HOWEVER, if I reverse the order in which the methods are called, I see this:

20000 Formatted Inserts: 3 seconds Avg.
20000 Unformatted Inserts: 2.5 seconds Avg.

So I conclude that the 0.5 second difference has nothing to do with
the SQL format, but is attributable to basic startup stuff.  In other
words, whichever method is called first is somewhat slower regardless
of the format of the SQL.  This is not surprising.  The difference is
not exponential, but fairly constant.  If I increase the inserts to
50000 or 100000, the first method is still about 0.5 seconds slower.
Again, not surprising.

There may be a legitimate issue here, but I'm not convinced it has
anything to do with iBATIS or SQL format (sorry).

Jeff Butler


On Wed, Feb 4, 2009 at 12:29 AM, M. Goodell <mgglist@comcast.net> wrote:
> Attached is a simple application showing perfomance data based on
> formatted/unformatted SQL insert statements. IDE=NetBeans 6.5
>
> 1. You will need to edit the spring.xml file and change the database config
> accordingly.
> 2. See included: people.sql for SQL DDL
> 3. See log4j.properties to adjust log output verbosity.
> 4. Dependencies (exact jars I used):
>        commons-dbcp-1.2.2.jar
>        commons-logging-1.1.1.jar
>        commons-logging.jar
>        commons-logging-api-1.1.1.jar
>        commons-pool-1.4.jar
>        ibatis-2.3.4.726.jar
>        log4j-1.2.15.jar
>        mysql-connector-java-5.1.7-bin.jar
>        spring.jar (2.5.6)
>
> 5. Database:
>        MySQL 5.1.30-community
>
> My results with this application on my system are:
>
> 2009-02-03 23:15:29,222 main springibatis.Main INFO - Inserting [20000]
> records into table.
> 2009-02-03 23:15:39,519 main springibatis.Main INFO - Milli-seconds using
> [formatted] SQL:10297
> 2009-02-03 23:15:41,879 main springibatis.Main INFO - Milli-seconds using
> [un-formatted] SQL:2360
> 2009-02-03 23:15:41,879 main springibatis.Main INFO - Difference in
> milli-seconds: 7937
>
> If there is more information needed I am glad to provide it.
>
> A *BIG* Thank You to everyone who has taken the time to look at this. If
> it's something I am doing / not doing please keep the name calling to a
> minumum. =)
>
> Thanks!
>
> M. Goodell
>

Mime
View raw message