Recently I had some discussions with a customer of ours that landed doubt on the fact that Web Dynpro context access is the fastest possible way to create and retrieve data within a Web Dynpro application. Since I didn’t found any benchmarks from SAP direct, I just decided to test the thing myself.
The application is relatively simple, including one non-visual and one visual controller with their contexts mapped. The component controller context looks like this:
We have a context node People that is mapped to a Structure and having the cardinality: 0..n. The other node is just a helper to hold the record count attribute, which is mapped to the input field in the view controller. The complete UI mask has the following look:
The button on top is mapped to an action that calls a method in the non-visual controller. The method itself implements the creation of the elements and the calculation the time intervals:
Our application is ready to be tested. I’ve ran it for 4 different record counts a couple of times. You can see the results in the following table:
A screenshot from the last test also shows that the record creation for 1 million records could vary depending on the current load of the J2EE Server:
I guess after this small representation of what the Web Dynpro context is capable of, no one is in doubt that it is one of the fastest possible way to access data in a running Web Dynpro application.
On popular demand I also tested how long it would take to save the data to a java array from a java class that has the same properties. The results were impressive – 1 000 000 records within 3 to 4 seconds. Not bad, but we must not forget that this includes only writing to the array and the display is not taken into account and believe me displaying a java array in Web Dynpro still means that you have to save the data to the context. Another aspect is the typed API that the Web Dynpro context provides and is so easy to work with. Whereas with java classes, we would have to generate the get and set methods manually or at best automatically with NWDS integrated functionality.