To give you some indication, I created a Eclipse RCP application that has two views, each loading the same 1 million domain objects (a simple POJO with some 15 properties, of which only 6 gets displayed in the table as columns) into a normal SWT Table and a NatTable respectively.
Performance
The difference in performance (over multiple runs) is mind-blowing:
SWT Table took on average 57 seconds to load these entries and display the table. And that was with only one column and no column header displayed. (I decided to keep the SWT table as simple as possible, as I was trying out NatTable's API).
NatTable took on average 4,5 seconds to load. Yes, four-and-a-half seconds!. That is less than a tenth of the time it took for the SWT Table. And in the NatTable view I had 6 columns, with alternating row colours. In addition the NatTable's columns were all movable and had a custom column-header renderer.
Memory Usage
It does not stop at performance. I also tested the app's memory usage (loading only a single View at a time) . After doing a System.gc(), the app with only the normal SWT Table widget in a View (loaded with 1 million entries) was using on average 430Mb of memory.
The NatTable version was using only 300Mb of memory.
I'm busy moving my implementation over to using NatTable... will you?

1 comments:
Very interesting. I wonder what the reason is for this difference. The NatTable pages provides a clue:
"In order to support very large grids, NatTable does not allocate widgets for every cell in the grid. Instead, it draws each cell on a scrollable SWT canvas."
Post a Comment