Kevin-
In some JPQL parsing, we need to check to see if a token is a class
name or a variable or something else, and we only check that by
trying a Class.forName(). What kind of performance hit are you seeing
from this? Are these happening from the same query string, or
different query strings?
In general, class loading slowness is one of those things that is
frequently very fast in a stand-alone environment, but can slow down
dramatically in a managed environment (due to the additional
complexities of class loading that containers often need to have). It
would be interesting if you could try the same set of queries in both
a stand-alone and managed environment and compare the results.
It could be the sort of thing where we just need to cache name-class
mappings (including lookup failures) in the JPQLExpressionBuilder and
see if that helps at least with repetitive name lookups.
On Oct 25, 2006, at 7:24 PM, Kevin Sutter wrote:
Hi,
We're doing some primitive performance comparisons and the results
could be
better... I'm wondering whether there are some configuration
properties
that need to be tweaked to get more suitable performance. I've
enabled the
DataCache and the QueryCache via the following properties, but they
didn't
help much:
property name=openjpa.DataCache value=true/
property name=openjpa.RemoteCommitProvider
value=sjvm/
property name=openjpa.QueryCache value=CacheSize=1000,
SoftReferenceSize=100/
Looking at some of the thread dumps in sample executions, there
seems to be
a common theme with this reflective classloading. (The sample is a
simple
jpql finder invocation that uses getSingleResult().) Is this normal
processing? Or, is there some configuration option(s) that would
help with
this? Thanks for any ideas.
(BTW, this callstack is from a 0.9.0 driver, but we have also
reproduced
this with a 0.9.5 driver as well.)
4XESTACKTRACE at
java/lang/ClassLoader.loadClass(ClassLoader.java:561(Compiled
Code))
4XESTACKTRACE at java/lang/Class.forNameImpl(Native Method)
4XESTACKTRACE at java/lang/Class.forName(Class.java:164
(Compiled
Code))
4XESTACKTRACE at serp/util/Strings.toClass(Strings.java:160
(Compiled
Code))
4XESTACKTRACE at serp/util/Strings.toClass(Strings.java:140
(Compiled
Code))
4XESTACKTRACE at org/apache/openjpa/kernel/QueryImpl.toClass(
QueryImpl.java:1552(Compiled Code))
4XESTACKTRACE at org/apache/openjpa/kernel/
QueryImpl.classForName(
QueryImpl.java:1499(Compiled Code))
4XESTACKTRACE at
org/apache/openjpa/kernel/ExpressionStoreQuery$1.classForName(
ExpressionStoreQuery.java:104(Compiled Code))
4XESTACKTRACE at
org/apache/openjpa/kernel/jpql/
JPQLExpressionBuilder.getPathOrConstant(
JPQLExpressionBuilder.java:1247(Compiled Code))
4XESTACKTRACE at
org/apache/openjpa/kernel/jpql/JPQLExpressionBuilder.eval(
JPQLExpressionBuilder.java:861(Compiled Code))
4XESTACKTRACE at
org/apache/openjpa/kernel/jpql/JPQLExpressionBuilder.getValue(
JPQLExpressionBuilder.java:1356(Compiled Code))
4XESTACKTRACE at
org/apache/openjpa/kernel/jpql/JPQLExpressionBuilder.getValue(
JPQLExpressionBuilder.java:1342(Compiled Code))
4XESTACKTRACE at
org/apache/openjpa/kernel/jpql/JPQLExpressionBuilder.eval(
JPQLExpressionBuilder.java:702(Compiled Code))
4XESTACKTRACE at
org/apache/openjpa/kernel/jpql/JPQLExpressionBuilder.getExpression(
JPQLExpressionBuilder.java:1333(Compiled Code))
4XESTACKTRACE at
org/apache/openjpa/kernel/jpql/JPQLExpressionBuilder.eval(
JPQLExpressionBuilder.java:709(Compiled Code))
4XESTACKTRACE at
org/apache/openjpa/kernel/jpql/JPQLExpressionBuilder.evalWhereClause(
JPQLExpressionBuilder.java:484(Compiled Code))
4XESTACKTRACE at
org/apache/openjpa/kernel/jpql/
JPQLExpressionBuilder.getQueryExpressions(
JPQLExpressionBuilder.java:261(Compiled Code))
4XESTACKTRACE at org/apache/openjpa/kernel/jpql/
JPQLParser.eval(
JPQLParser.java:58(Compiled Code))
4XESTACKTRACE at
org/apache/openjpa/kernel/ExpressionStoreQuery
$DataStoreExecutor.init(
ExpressionStoreQuery.java:648(Compiled Code))
4XESTACKTRACE at
org/apache/openjpa/kernel/ExpressionStoreQuery.newDataStoreExecutor(
ExpressionStoreQuery.java:162(Compiled Code))
4XESTACKTRACE at
org/apache/openjpa/kernel/QueryImpl.createExecutor(QueryImpl.java:
675(Compiled
Code))
4XESTACKTRACE at
org/apache/openjpa/kernel/QueryImpl.compileForDataStore
(QueryImpl.java:633(Compiled
Code))
4XESTACKTRACE at
org/apache/openjpa/kernel/QueryImpl.compileForExecutor
(QueryImpl.java:609(Compiled
Code))
4XESTACKTRACE at org/apache/openjpa/kernel/
QueryImpl.getOperation(
QueryImpl.java:1421(Compiled Code))
4XESTACKTRACE at
org/apache/openjpa/kernel/DelegatingQuery.getOperation
(DelegatingQuery.java:120(Compiled
Code))