[JBoss Microcontainer Development] - Testing Deployers with new Reflect + ClassPool
by alesj
Reporting my findings on the new ClassPoolTestCase:
- http://anonsvn.jboss.org/repos/jbossas/projects/jboss-deployers/trunk/dep...
All the simple deployment tests pass,
it was the more hierarchy complex (if you can call .ear complex) that immediately failed for me.
It appeared that the old ClassPool's ClassLoader was used:
| junit.framework.AssertionFailedError: expected:<BaseClassLoader@135da43{vfs://top-level.ear/}> but was:<BaseClassLoader@2cbc86{vfs://simple.jar/}>
| at org.jboss.test.deployers.vfs.classpool.test.ClassPoolTest.assertClassPool(ClassPoolTest.java:83)
| at org.jboss.test.deployers.vfs.classpool.test.ClassPoolTestCase.testBasicEar(ClassPoolTestCase.java:82)
Then I tied the RegisterModuleCallback with ClassLoading to properly track Module creation/destruction.
| <bean name="RegisterModuleCallback" class="org.jboss.classpool.plugins.as5.RegisterModuleCallback">
| <install method="addModuleRegistry" bean="ClassLoading" whenRequired="Start">
| <parameter><this/></parameter>
| </install>
| <uninstall method="removeModuleRegistry" bean="ClassLoading" whenRequired="Start">
| <parameter><this/></parameter>
| </uninstall>
| </bean>
|
This now looks like something simply snatches CL under the ClassPool:
| junit.framework.AssertionFailedError: expected:<BaseClassLoader@bafdff{vfs://top-level.ear/}> but was:<null>
|
Also, the assertClassPool method doesn't look valid for all classes.
e.g. top deployment unit's classloader cannot see war's classes --> AnyServlet.class in testBasicEar
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4260467#4260467
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4260467
16 years, 5 months
[JBoss XML Binding Development] - Customizing XB and performance testing
by alex.loubyansky@jboss.com
So, the previous tests show that generated parsers/handlers show the best time and significant difference. (Although the time and difference should be taken as a landmark value taking into account that Fast JAXB at this point is very limited in its features and doesn't even collect characters into string values correctly, although it's not affecting the current testcase). This could be a way to go.
Starting from scratch though is not the best idea taking into account how much code is using XB and its custom features. Besides, XB-specific annotations and API features, XB kind of extends SAX events, i.e. to events like start/end element, characters, etc it adds start/end model group (sequence, choice, all, unordered sequence), start/end wildcard. This is necessary to support binding not only to types and elements but also to groups of elements. This is by the way is missing from JAXB as well at this point. And our projects do use this feature often.
The good thing is that this SAX extension, i.e. the event-producing part of XB is separate from its event-handling part. So, the first thing to try going forward, IMO, would be to try to keep the event-producing part (which is based on SchemaBinding API) and try generating handlers for the event-handling part. In fact, in XB you can always write your own custom handler and plug it in. Which is what I did for the next test.
| Parser____first run__1_____10_____100_____1000
| FastJAXB__113.7______2.5___19.8___127.8___838.6
| JAXB______112.7______4.2___36.1___172.1___1080.1
| CustomXB__146.4______5.4___43.0___206.4___1201.8
| XB________153.2______6.3___51.1___245.6___1348.7
|
first run - first parsing
1, 10, 100, 1000 - number of iterations (parsings) after the first run
the time is in milliseconds
So, there is some improvement comparing to the default XB but we still don't beat JAXB and significantly slower than Fast JAXB.
I am sure event-producing part can be optimized but it's difficult to say how much at this point.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4260355#4260355
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4260355
16 years, 5 months