openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francesco Chicchiriccò <>
Subject Re: H2 poor performance?
Date Wed, 25 Jan 2012 15:47:20 GMT
On 24/01/2012 15:54, Kevin Sutter wrote:
> First of all, Congratulations on your migration from Hibernate to OpenJPA.
>   I'm glad to hear that things worked out well for you during this effort.

Hi Kevin,
thanks for your answer.

> As far as H2 performance...  My guess is that the H2 Dictionary may not
> have been kept up to date with improvements to H2 features and SQL
> improvements.  These dictionaries have been maintained as needs arise and
> as expertise provides input and feedback.  For example, our DB2 customers
> provide input for the DB2 dictionary, Oracle users provide input for the
> Oracle dictionary, etc.  I looked back on my notes and I don't see an
> expert identified for H2.  Would you like to provide that service?  :-)

Well, I am not an H2 expert at all: I am just using it for integration 
Anyway, if I ever find something interesting on this topic, be sure that 
I'll do my best for providing an adequate patch ;-)

> Since the performance of MySQL and Postgres seem to be acceptable, I would
> assume that the deficiencies are probably localized to the dictionary.  I
> would start by turning on Trace while running your test bucket.  The full
> Trace output will show the timings for executing the various SQL.  Maybe
> you'll find SQL being generated that is not efficient for H2.  You could
> also review the H2 Dictionary and see if some of the basic properties may
> not be set correctly for H2.  Maybe comparing MySQL and/or Postgres
> dictionaries and trace output with H2's.

Following your advices, I've put log4jdbc [2] at work and found that, 
quite interestingly, the total time spent in querying H2 is quite less 
than the total time spent in querying MySQL.
Since, as said before, the total time taken by tests is less with MySQL 
than with H2, I think that there must be some kind of latency.

Does this say something more?


> 2012/1/24 Francesco Chicchiriccò<>
>> Hi all,
>> I am currently facing some strange behavior with in-memory H2.
>> In my project - Syncope Open Source IdM [1] - we recently moved from
>> Hibernate to OpenJPA: everything is now working and I can safely say
>> that the porting is functionally complete.
>> Our source code does some integration tests with Tomcat 7 and an
>> in-memory H2 instance: unfortunately H2 performs really bad in such
>> circumstances. Only consider that all tests take 128 secs to run, while
>> same tests take only 96 secs with PostgreSQL and 77 with MySQL.
>> When running the same test suite against last Hibernate-based build, it
>> turns out instead that H2 is faster than MySQL and PostgreSQL (as I
>> would expect given the small test dataset).
>> Is there anything special I should take care of when using in-memory H2?
>> TIA.
>> Regards.
>> [1]

Francesco Chicchiriccò

Apache Cocoon Committer and PMC Member

View raw message