db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel John Debrunner <...@debrunners.com>
Subject Re: Derby vs. HSQL
Date Thu, 09 Sep 2004 15:57:47 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Wes Johnson wrote:

> Sure, it's below.  Definitely not the greatest code in the world, but it
> is the exact same code that I'm using to test HSQL.
>
> Thanks!!!
>

A few notes on the test code.

1) Derby's (& Cloudscape's) connection will be in auto-commit mode. This
means every statement executed results in a commit. This is the JDBC
standard for newly created connections. This means a flush of the
transaction log will occur after every statement, depending on your
disk, operating system and jvm this can take up to 20ms. This also leads
to the mostly idle state when running this test, it's all waiting for
the data to be synced to the physical disk.

2) Your query() method does not perform a complete query in Derby and
most likely will do different amounts of work on different JDBC
implementations. To perform a fair and realistic benchmark each row and
each column should be fetched from the ResultSet. e.g.
    while (rs.next()) {
       rs.getInt(1);
       rs.getString(2);
       rs.getInt(3);
    }

3) The timed portion of the test uses 50,000 java.sql.Statement objects,
 Statement objects can be re-used, thus this code could use just one
Statement and avoid the cost of object creation and associated garbage
collection.


Dan.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFBQH16Iv0S4qsbfuQRAtE1AJ9KCdwOOpYorIldTaHHbCZSEc7EegCguHRw
MaC6o17kFxxcypK8tq2idQQ=
=HlkX
-----END PGP SIGNATURE-----


Mime
View raw message