db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DerbyNovice <clars...@ureason.com>
Subject Re: Derby/HSQLDB major performance difference
Date Tue, 10 Mar 2009 12:21:47 GMT

DerbyNovice wrote:
> I am using Derby as an embedded db in my swing application. Recently I
> decided to have a go at HSQLDB (cached tables, embedded) to see  how it
> coped. I have written a test program which
> *  inserts a number of records in my db with random keys
> * makes an index on the keys. 
> * runs a number of select statements
> * updates a number of records with new random values.
> At the same time I measure lapse time and memory in a separate thread.
> I made the same run with Derby and with HSQLDB, see the two uploaded
> charts, with -Xmx1024m .
> Initially the idea was to see which db was faster, but as soon as I saw
> the results I realised there are
> other differences.
> The scale on the x-axis is half seconds, i 1000 is 500 seconds. The scale
> on the y-axis is bytes as reported by gc.
> Notice the difference in scale between HSQLDB and derby. I have tried to
> optimise the memory with HSQLDB options
> but it has only marginal difference and it does not change the behaviour.
>  Observations:
> * HSQLDB uses a magnitude more memory than Derby.
> * HSQLDB does not seem to benefit from the indices.
> * HSQLDB is faster in total, but not to the extent the memory usage
> suggests.
> * Derby uses a very long insertion  period but the select statements are
> very fast and memory lean
> * Derby manages the memory during the run, the total memory goes up AND
> * Derby seems to struggle (timewise) with the inserts (the long slope
> initially) but breeze through the select statements
> which all take less than a second.
> The run shown uses 700000 records, but smaller runs show the same
> behaviour.
> For me this makes HSQLDB useless as it would gradually eat my applications
> memory. Anyone trying to weigh performance benefits between db's should be
> aware of these very different characteristics.
> I'd be pleased if anyone would care to comment on the test run and maybe
> shed some light on the totally different characteristics seen here.
> I'd be happy to upload the timing tests and my program too if there is an
> interest.
> Regards,
>  http://www.nabble.com/file/p22433093/derby.gif 
>  http://www.nabble.com/file/p22433093/hsql.gif 

View this message in context: http://www.nabble.com/Derby-HSQLDB-major-performance-difference-tp22377140p22433093.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.

View raw message