Friday, June 29, 2012

During stress load, we noticed complex ADF pages on load may produce more than one ADF passivation/activation events. This may decrease performance, because passivation/activation involves additional database calls plus ADF framework rendering functionality gets slower. We managed to debug one of such complex pages - this page was rendering many small tables in the same single page. During page load, it stress load environment, it was producing multiple activation/passivation events.

The trick was in Content Delivery setting for ADF Table component. By default this setting is set with whenAvailable value. While it works correctly, in some cases it may bring side effects for performance. If you notice slow performance for ADF table rendering - double check Content Delivery property for ADF table. We would recommend to set it to immediate.

This is not only ADF table performance rendering, there might be additional huge side effect for system performance based on ADF table configuration. Imagine - ADF table rendering is triggering multiple activation/passivation events. In turn this triggers multiple prepareSession() method invocations. Very often we call DB PL/SQL initialization logic from prepareSession() method. If invoked PL/SQL logic is complex, it will be invoked multiple times with table rendering and this will make your system slow.

As shown in the bean code, I changed the list getter method putting inside it the code to get the data from db.

Because the page load was very slow, I put a print line in the method, and I found out that the getter method, of the list which the table is bound to, is called many times (around 8 times) causing a massive performance reduction. This happens with all the lists declared into the page, even those whose the getter method in the bean does not make any db call.

And moreover, this thing happens independentely that the "contentDelivery" property value is set to "when available" or "Immediate".

Reasoning on it, I got to the conclusion that probably I am making some mistakes, and there must be another way to make the table be loaded the first time, from putting the db call into the getter method.