Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » NatTable Drawing FPS / Performance vs SWT table
NatTable Drawing FPS / Performance vs SWT table [message #1744125] Thu, 22 September 2016 14:03 Go to next message
Bernhard Buss is currently offline Bernhard BussFriend
Messages: 13
Registered: September 2014
Junior Member
Hello Dirk,

We are using NatTable in an editor in an eclipse RCP application, and for that Use Case it is indispensable because we need all the extra features like layers, grouped rows/columns, various row size, cell formatting and column handling, filter, sort, group by and so on. And the performance hasn't been a problem so far (there is no alternative to compare though; or is there?), or we just have to live with it.

However. We now wanted to move another use case for a table to NatTable, which currently uses JFace TableViewer and SWT Tree; it's a simple 3 columns by 100 to 500 rows tree table. Unfortunately, comparing the draw performance of the two technologies we had to find out that NatTable has a slight lag and lower FPS (visible when scrolling), compared to the SWT table which uses native rendering. This is on a Windows 7 machine (16GB RAM, 4 cores...). Obviously doing the rendering with SWT will be slower, but the problem is that it becomes noticeable slow.

I have also tried the example application (web start jar), and noticed the same small delay / low FPS (so that it becomes visible to the eye) in the example tables there. The size of the table doesn't really seem to matter (except for very small tables).

In today's age with super smooth scrolling on iPhones, the user can easily get annoyed by such lag and "low" FPS. My question is; is this a known but accepted "problem"? Are there any plans on improving that? Because for us this is a blocker to refactor our second use case.

And maybe related to that I read you are working on native JavaFX support. Would that have a better rendering performance?
How about moving to HTML5, any plans?

Thanks for your candid answer,
Bernhard
Re: NatTable Drawing FPS / Performance vs SWT table [message #1744132 is a reply to message #1744125] Thu, 22 September 2016 14:57 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2624
Registered: July 2012
Senior Member
Well you are the first person in the years that I worked on NatTable that complains about low FPS and laggy scrolling. So to answer your question, it is not known. Actually the intention of NatTable was to perform better than SWT. Some years ago I gave a talk where I compared the technologies.

Maybe the clipping introduced for smooth scrolling is responsible. But honestly I don't know if that is really the case.

Another option you could test locally is to checkout the sources and have a look at the EventConflaterChain that is used in NatTable. It collects all requests for re-rendering in an interval and triggers the rendering once for multiple such events. It is currently set to 100ms per default. When NatTable was created 100ms seemed to be a good value to reduce the processing time by still providing a good responsive table. Also by not conflating the events in such an interval would cause a flickering UI.

Nevertheless maybe the interval of 100ms is to high for todays PCs. For testing I reduced it to 50 which seems to make it more fluent. Another reduction to 20 didn't make much difference to 50. At least for my old eyes.

As I am not sure how you measured the low FPS I'm not sure if that is correct or not. Maybe you can test this locally to see if that fixes the issue and provide a patch.

With regards to the JavaFX support and NatTable 2.0 ... well currently I don't have time to bring this forward. And by keeping the same basic architecture and conflating events, the result would be the same. But as I said, probably we can reduce the conflation time.

Ah, with regards to the alternative, Nebula has some table/grid widgets you could try if NatTable doesn't satisfy your needs.
Re: NatTable Drawing FPS / Performance vs SWT table [message #1744140 is a reply to message #1744132] Thu, 22 September 2016 16:18 Go to previous messageGo to next message
Bernhard Buss is currently offline Bernhard BussFriend
Messages: 13
Registered: September 2014
Junior Member
Hi Dirk!

Thanks a lot for your answer, in fact, lowering the number

org.eclipse.nebula.widgets.nattable.conflation.EventConflaterChain.DEFAULT_REFRESH_INTERVAL

from 100ms to 40ms does the trick! This is really good news for us using NatTable!

I also tried 20ms, and it does actually even get smoother. 100ms interval is 10fps, 40ms is 25fps (~ movie framerate of 24), 20ms is 50fps (~ framerate 48 of The Hobbit movie, and at which video games are also considered smooth).

I would suggest to set it to 20ms. If the PC is slow, then I guess the events will be conflated at the fastest rate possible. If the PC is faster, well the eye wouldn't notice a higher FPS anymore.
This is for the scrolling event. I am not sure which kind of event or use case can cause the flickering you mentioned to appear. If some events have a problem with such a low interval, maybe the conflation interval can be made dependent on the events gathered.

Oh by the way, we are using NatTable 1.3 with eclipse 3.7, but I guess you have the same setting in your newest version as well.
Are you still patching that version?

Cheers,
Bernhard
Re: NatTable Drawing FPS / Performance vs SWT table [message #1744153 is a reply to message #1744140] Thu, 22 September 2016 20:23 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2624
Registered: July 2012
Senior Member
I created https://bugs.eclipse.org/bugs/show_bug.cgi?id=502029 and provided a patch. There I changed the 100ms default refresh interval to 20ms. Before the next release there should be enough time to test this by hopefully more people.

Additionally I added a new constructor that allows to specify a custom EventConflaterChain if the default doesn't match the expectations.

Quote:
Oh by the way, we are using NatTable 1.3 with eclipse 3.7, but I guess you have the same setting in your newest version as well.
Are you still patching that version?


As I said the EventConflaterChain exists for a long time. So yes it still exists. And no, I don't patch old versions.
Re: NatTable Drawing FPS / Performance vs SWT table [message #1744209 is a reply to message #1744153] Fri, 23 September 2016 11:36 Go to previous message
Bernhard Buss is currently offline Bernhard BussFriend
Messages: 13
Registered: September 2014
Junior Member
Thanks Dirk, much appreciated!
Next Topic:CalculatedValueCache Deadlock
Goto Forum:
  


Current Time: Fri Nov 16 12:43:11 GMT 2018

Powered by FUDForum. Page generated in 0.03132 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top