Friday, February 12, 2010

ExtendedDataTable Vs DataTable

I am currently using Richfaces 3.3.1 with in my seam application and here are few things related to ExtendedDataTable that are worth sharing.

If you are working with a simple Data Iteration(table) with say 5 columns of data, the rendering times for ExtendedDataTable(EDT) and DataTable(DT) appear to be similar. In this particular case using EDT gives you the biggest bang for the buck with all the functionality that comes with it. But, as the number of columns of data in your table increase the performance become more of an issue. Let me explain...

In the application I am working on, we have a screen that is critical part of the whole application and usecases have shown that the user will spend majority of their time on this screen. The screen contains a table with about 18 columns of critical data. The user is allowed to sort, launch some actions from the context menu etc. None of the fancy stuff like the 'grouping' or re-arranging of columns etc. (For the time being, until we have some more scope creep)

We are currently in the performance enhancement phase of development and I noticed that converting the screen from EDT to DT with pretty much the same functionality reduced the rendering time of the table by almost half. I did this using FireFox console output feature that will output to FireBug console. This is the best way I have found to check the elapsed time of different parts of the screen. I am planning to cover FireBug debugging in a different blog post.

To give you some numbers;
  • EDT render time 1612 ms and DT render time for the same data 916 ms. That is pretty significate when you are talking screen delay, especially if you have to deal with KPI's like we do.
  • Some actions on the screen just refresh the list or table using the Ajax "reRender" attribute available. This happens to update "Status" of a row lets say and the re-rendering times for this EDT 600ms and DT 200ms.
So, if you
  • Need the extra features offered by ExtendedDataTable like "Group By" or "reorder columns" etc
  • Displaying a small number of columns
  • Not a heavy usage screen
Then go ahead and use ExtendedDataTable's.
Else, stick with DataTable's for the time being.

When and if I try the latest build of Richfaces and notice any significant improvement from EDT, I will do a follow up to this post.

If any of you have found better ways to handle this issue of EDT or other performance improvements that can be attained, please share.

Regex Gem

Although I have been programming for over 10 years now, I often find myself looking up some regex stuff (Regular Expressions) whenever I need to do something with it. I would like to think that all programmers do that at one point or another, but can't be sure :-)

Couple of months ago when I was in a similar situation looking for help online, I came across RegExr. It is very simple but extremely useful website for any one learning regular expressions or looking for a quick regex help to continue with what they might be doing.


It is a flash based application that will allow you try out any regular expression at the press of a button and see the results live. The text in the textarea is just an example and can be replace with what ever you need and run regular expression against that. On the right you have a complete list of all the options available for use in a regular expression along with description.

Best of all it is free. Click on the link above to check it out. If you like it or not, leave me a note of what you think.

If you have found other tools that are similar or helpful with other programming type things, please share.