HSQLDB-based library very slow: trying to narrow down search for bug
<p>I integrated a 3rd-party library into my Java project. This library depends on <code>HSQLDB.jar</code>. This library -- and thus the version of <code>HSQLDB.jar</code> that came with it -- is a bit old, last updated in 2010. It's also pretty large. In my code, I loop over data points and call the library to perform some calculations. What I noticed is the time required for processing grows more or less exponentially with the number of data point. For example, for 100 points, the difference compared to the version not using the library is tiny; for 2000 points the difference is about an hour; for 5000 points it takes a couple of days to complete compared to a couple of hours without it!</p>

<p>I tried updating <code>HSQLDB.jar</code> to the latest version but that a bunch of exceptions so I reverted back to the old one.</p>

<p>I ran <code>hprof</code> and it reported that a very large portion of total time is spent in <code>org.hsqldb.persist.Cache.cleanUp</code>. What I am trying to do now is somehow narrow down my search for what the problem is and/or where it occurs. Since it's only noticeable when a lot of input data is processed, I want to do some preliminary "triage" before I start doing debugging runs.</p>

<p>Unfortunately, at this point I can't show any code excerpts here since I don't know what excerpts are relevant...</p>

<p>So my question is this: does the fact that it's spending too much time in <code>org.hsqldb.persist.Cache.cleanUp</code> indicate the source of the problem?</p>