The "Entity Bean
Performance Tuning Help" thread went off in various different directions. The
thread begged a sample and a little more detail as to what was slow. I've
identified the problem to be (CMRs) and provided a full sample
(attached).
Lets rehash what
i'm testing:
The code runs inside of a SSB with a transaction on each method vs servlet
(struts action) + manual transaction as in the real app. I use hypersonic
vs oracle in my real app.
calls findAll()
dumps out
the time
iterates through each calling all methods and building a
valueobject.
this should
cache all results (checkout my jboss.xml)
iterates through each calling all methods and building a valueobject (a 2nd
time)
dumps out
the time
iterates through each and calling 1 method on ejb, which builds the valueobject
internally
dumps out
the time
I'm mostly
concerned with the last time, as it's what i do in my real case...because it's
the fastest.
The entitybean has
2 CMRs. The read-all+fields time for 1000 cached beans using internal
valueobject generation takes about 670ms. But with 1 cmr it only takes 350ms.
And with No cmrs it only takes 150ms. [if you want slightly modified code, let
me know].
Now 150ms is
great! But 350 isn't. It's more then double. Is this acceptable? Add a few more
and it's unusable for a lot of applications.
Arguably cmp
EntityBeans were worthless till ejb2.0 and CMRs came along. But to actually use
them in JBoss is suicide for performance.
The attached sample has a test class called "Test",
which can be run with -c to generate 1000 test rows. Also included is an ant
script which builds the test beans and deploys them to jboss, if you set your
jboss.install path in build.properties.
Here the actual
output from my last test run:
14:31:36,312
INFO [STDOUT] creating 1000 Blobs...
14:31:43,968 INFO [STDOUT]
Creation complete, took 7656ms.
14:31:46,328 INFO [STDOUT] testing
retrival speed...
14:31:46,328 INFO [STDOUT] Initial Retrival, beans
may or maynot be in cache.
14:31:46,375 INFO
[STDOUT] finder took 47ms.
14:31:49,140 INFO
[STDOUT] External ValueObject creation took 2765ms for
1000 objects.
14:31:49,859 INFO [STDOUT]
Internal ValueObject creation took 719ms for 1000 objects.
14:31:49,859
INFO [STDOUT] Secondary Retrival, beans are in cache.
14:31:50,125
INFO [STDOUT] finder took 266ms.
14:31:52,765
INFO [STDOUT] External ValueObject creation took
2640ms for 1000 objects.
14:31:53,437 INFO
[STDOUT] Internal ValueObject creation took 672ms for
1000 objects.
These results also
beg the question of why the interceptor stack takes so long to transversion,
hense the extra 2000ms for 1000s ejbs, but lets leave that for a seperate
thread.
.peter
<as always
ignore my companies crazy warning message below>
This transmission contains information solely for intended recipient and may be privileged, confidential and/or otherwise protect from disclosure. If you are not the intended recipient, please contact the sender and delete all copies of this transmission. This message and/or the materials contained herein are not an offer to sell, or a solicitation of an offer to buy, any securities or other instruments. The information has been obtained or derived from sources believed by us to be reliable, but we do not represent that it is accurate or complete. Any opinions or estimates contained in this information constitute our judgment as of this date and are subject to change without notice. Any information you share with us will be used in the operation of our business, and we do not request and do not want any material, nonpublic information. Absent an express prior written agreement, we are not agreeing to treat any information confidentially and
will use any and all information and reserve the right to publish or disclose any information you share with us.
entitybean-withcmr-perf-test.zip
Description: Binary data