Performance gap between JBoss 7.1 and Wildfly 8.0
max_kuffs Apr 17, 2014 3:38 AMHello,
I migrated a project from JavaEE6 to JavaEE7 and switched my development server from JBoss 7.1 to Wildfly.
This was quite straight forward, but then I ran into a timeout in one of my integration tests. That was quite odd, because I never tweaked JBoss in any way. I used both products out of the box (just added datasources and realm) and I had never performance issues during development.
First I analyzed which part of my code caused this behaviour. I extracted the code parts into a smaller Rest Service and started the profiler. The same code ran on JBoss and Wildfly without any changes. In Wildfly there is a lot of noise from WELD and logging. The business logic comes way down on the chart. In JBoss 7 the business logic comes right on the second place and looks like I would expect it.
My test szenario:
// Entity loading happens before. No lazy loading or any other database access involved.
for(int i = 0; i< 1000;i++) {
log.info("Run {}", i);
SightContainer sightBefore = sightService.getGlobalSight(game);
SightContainer sightAfter = sightService.getGlobalSight(game);
sightService.createCreateRemoveEvents(game, sightBefore, sightAfter);
}
getGameObjectsCached(Game) retrieves the list of objects once from the database and then pins it with the TransactionSynchronizationRegistry onto the transaction. That worked very good so far.
public SightContainer getGlobalSight(Game game) {
...
List<GameObject> objects = gameObjectService.getGameObjectsCached(game);
int objectsWithSightCount = 0;
for (GameObject objToSightTest : objects) {
...
objectsWithSightCount++;
Set<GameObject> objectsInSight = getObjectsInSightOfObject(objToSightTest); // iterating over objects and checking the lines. plain java so far.
...
}
log.info("Sight calculation of {} objects took {}ms", objectsWithSightCount, System.currentTimeMillis() - start );
...
}
On Wildfly:
09:19:53,072 INFO [net.hq.test.TestWithinContainer] (default task-1) Run 1
09:19:54,508 INFO [net.hq.service.SightService] (default task-1) Sight calculation of 6 objects took 1436ms
09:19:55,882 INFO [net.hq.service.SightService] (default task-1) Sight calculation of 6 objects took 1374ms
On Jboss:
09:24:02,386 INFO [net.hq.test.TestWithinContainer] (http-localhost-127.0.0.1-8080-1) Run 1
09:24:02,448 INFO [net.hq.service.SightService] (http-localhost-127.0.0.1-8080-1) Sight calculation of 6 objects took 62ms
09:24:02,509 INFO [net.hq.service.SightService] (http-localhost-127.0.0.1-8080-1) Sight calculation of 6 objects took 60ms
In my application I have to calculate sight lines between objects which are described with coordinates. So I have to iterate a lot and use the DDA Algorithm to draw a line and look if it is blocked by anything. There is no Hibernate involved in this point so the calculation happens without any database access. I optimized out a lot yesterday. Before I had a factor 10 difference.
I guess I have to change my wildfly configuration in any way. My question is ...which one? At this stage of development I run both servers in eclipse. So I did not expect the full performance. What bothers me is the performance gap between the two servers.
greetings,
m
-
Jboss 7.1 Profile.PNG 88.6 KB
-
Wildfly Profile.PNG 100.5 KB
-
standalone_wildfly.xml 22.2 KB
-
standalone_jboss.xml 18.0 KB