Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Is there a way to delete the data EList (Xcore) from my tableviewer faster?(Is there a way to delete the data EList (Xcore) from my tableviewer faster?)
Is there a way to delete the data EList (Xcore) from my tableviewer faster? [message #1828265] Fri, 05 June 2020 08:20 Go to next message
Patrick Kremer is currently offline Patrick KremerFriend
Messages: 1
Registered: June 2020
Junior Member
Hi,
i connected a table viewer to an EList (xcore) via databinding.

ObservableListContentProvider listContentProvider = new ObservableListContentProvider();
IObservableMap[] observeMaps = EMFObservables.observeMaps(listContentProvider.getKnownElements(), new EStructuralFeature[]{Literals.TEST1__NAME});
tableViewer.setLabelProvider(new ObservableMapLabelProvider(observeMaps));
tableViewer.setContentProvider(listContentProvider);
//
IObservableList testInputObserveList = EMFObservables.observeList(Realm.getDefault(), test, Literals.TEST__INPUT);
tableViewer.setInput(testInputObserveList);

I have a lot of records (+/-4000 Entrys) in my table and i want to delete them with the code clear(), the deletion process takes several seconds.

test.getInput().clear();

Is there a way to delete the data from my table faster?

thanks



Re: Is there a way to delete the data EList (Xcore) from my tableviewer faster? [message #1828292 is a reply to message #1828265] Sat, 06 June 2020 03:47 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 31825
Registered: July 2009
Senior Member
Looking at the implementation I expect that a single notification is produced and handled by this part of the code to compute the diff:

https://git.eclipse.org/c/emf/org.eclipse.emf.git/tree/plugins/org.eclipse.emf.databinding/src/org/eclipse/emf/databinding/EObjectObservableList.java#n112

I expect that part is O(n) to compute the list of diffs. The diff is then fired here:

https://git.eclipse.org/c/emf/org.eclipse.emf.git/tree/plugins/org.eclipse.emf.databinding/src/org/eclipse/emf/databinding/EObjectObservableList.java#n150

And after that the observer implementation does all the work and if it's that slow, likely there is some O(n^2) work being done there.

But I see no special support for "clear" in the platform's data binding framework, so there is nothing I see that you can optimize at your end or that I can optimize in the EMF framework in this regard.

In the end, to optimize anything like this, one would need to measure where the costs are with a profiler. YourKit is very good...





Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:[Transaction] Lifecycle events for nested transactions
Next Topic:TableViewer of EMF object with calculated column?
Goto Forum:
  


Current Time: Sun Apr 11 05:14:39 GMT 2021

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

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

Back to the top