Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » [Databinding] Performance issues with IObservableMap and non-trivial table sizes
[Databinding] Performance issues with IObservableMap and non-trivial table sizes [message #516725] Wed, 24 February 2010 22:14 Go to next message
Anthony Juckel is currently offline Anthony JuckelFriend
Messages: 19
Registered: July 2009
Junior Member
I'm working on an RCP app which is needing to rely rather heavily upon databinding for a table of data with roughly 10,000 rows. This didn't seem like a lot of data to me, but the performance is horrendous (completely unusable) thus far, even with mostly static data.

First, some background. I'm using EMF for the data model, a simple TableViewer with an ObservableListContentProvider, and the intput on the TableViewer is set by viewer.setInput(EMFProperties.list(structuralFeature).observ e(container);. Columns in the viewer are using my own LabelProvider based off IObservableMaps from the content items to the property I want to display.

I'm adding all 10,000 elements to the list in one call to addAll, which is bubbling up the listener chain, but at some point, the list of content elements is being translated into a list of 10,000 nulls.
In particular, all the way through EMFObservableMapDecorator.fireEvent, I see the proper list of content items in event.diff.newValues. But, masterListener.handleMapChange does the following:

public void handleMapChange(final MapChangeEvent event) {
if (!isDisposed()) {
updateKnownValues();
if (!updating)
fireMapChange(convertDiff(event.diff));
}
}
where updateKnownValues is:
private void updateKnownValues() {
Set knownValues = new IdentitySet(masterMap.values());
knownMasterValues.retainAll(knownValues);
knownMasterValues.addAll(knownValues);
}

At the point this is called, masterMap.values() returns just a collection of nulls. These nulls are then wrapped in IdentityWrappers and added to an IdentitySet. IdentityWrapper says hashCode of a wrapped null is 0, but two wrapped nulls are not equal, so the hash set degrades to a linked list, and we have to do 50,000,000 comparisons of 10,000 IdentityWrappers.

I'm still digging to find out when exactly masterMap.values() gets properly populated, but this smells of something being done out of order.
Re: [Databinding] Performance issues with IObservableMap and non-trivial table sizes [message #516736 is a reply to message #516725] Wed, 24 February 2010 22:44 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Anthony,

It's probably best you create a test case that simulates this problem
and open a bugzilla for it. It might be a basic data binding problem or
a problem related to how EMF integrates to it. Probably it makes sense
to open the bugzilla against EMF so Tom or I can have a look.


Anthony Juckel wrote:
> I'm working on an RCP app which is needing to rely rather heavily upon
> databinding for a table of data with roughly 10,000 rows. This didn't
> seem like a lot of data to me, but the performance is horrendous
> (completely unusable) thus far, even with mostly static data.
>
> First, some background. I'm using EMF for the data model, a simple
> TableViewer with an ObservableListContentProvider, and the intput on
> the TableViewer is set by
> viewer.setInput(EMFProperties.list(structuralFeature).observ
> e(container);. Columns in the viewer are using my own LabelProvider
> based off IObservableMaps from the content items to the property I
> want to display.
>
> I'm adding all 10,000 elements to the list in one call to addAll,
> which is bubbling up the listener chain, but at some point, the list
> of content elements is being translated into a list of 10,000 nulls.
> In particular, all the way through
> EMFObservableMapDecorator.fireEvent, I see the proper list of content
> items in event.diff.newValues. But, masterListener.handleMapChange
> does the following:
>
> public void handleMapChange(final MapChangeEvent event) {
> if (!isDisposed()) {
> updateKnownValues();
> if (!updating)
> fireMapChange(convertDiff(event.diff));
> }
> }
> where updateKnownValues is:
> private void updateKnownValues() {
> Set knownValues = new IdentitySet(masterMap.values());
> knownMasterValues.retainAll(knownValues);
> knownMasterValues.addAll(knownValues);
> }
>
> At the point this is called, masterMap.values() returns just a
> collection of nulls. These nulls are then wrapped in IdentityWrappers
> and added to an IdentitySet. IdentityWrapper says hashCode of a
> wrapped null is 0, but two wrapped nulls are not equal, so the hash
> set degrades to a linked list, and we have to do 50,000,000
> comparisons of 10,000 IdentityWrappers.
>
> I'm still digging to find out when exactly masterMap.values() gets
> properly populated, but this smells of something being done out of order.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: [Databinding] Performance issues with IObservableMap and non-trivial table sizes [message #516768 is a reply to message #516736] Thu, 25 February 2010 04:04 Go to previous message
Anthony Juckel is currently offline Anthony JuckelFriend
Messages: 19
Registered: July 2009
Junior Member
I've opened as https://bugs.eclipse.org/303847

On 2/24/10 4:44 PM, Ed Merks wrote:
> Anthony,
>
> It's probably best you create a test case that simulates this problem
> and open a bugzilla for it. It might be a basic data binding problem or
> a problem related to how EMF integrates to it. Probably it makes sense
> to open the bugzilla against EMF so Tom or I can have a look.
>
Previous Topic:examples on using hyperlinkDetectors?
Next Topic:IFolder.move() gives exception on windows machine
Goto Forum:
  


Current Time: Thu Apr 25 16:00:35 GMT 2024

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

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

Back to the top