Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Performance in scoping(performance in scoping)
Performance in scoping [message #1037229] Tue, 09 April 2013 06:02 Go to next message
paul lu is currently offline paul lu
Messages: 14
Registered: April 2013
Junior Member
We are developing a DSL with the complexity comparable to java or c++. Then the performance is largely impaired, typically in scoping...

One of the features we need to support is like finding all elements in super types which again would have other supertypes..., which is realized in scoping, but when the DSL code size increases, it's extremely slow

Xtext resources always need reloading in different usage, editting, build..., exactly the same process will repeat.

Is there any way to make things faster??
Re: Performance in scoping [message #1037543 is a reply to message #1037229] Tue, 09 April 2013 13:34 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6127
Registered: July 2009
Senior Member
Hi,

a starting point may be to store in information you need in the xtext index
(customizing IDefaultResourceDescriptionStrategy -> you can add user data there)
and then in the scope provider instead of travering the model
wrapping delegateGetScope into a FilteringScope)

since the index is inmemory this may be much faster than traversing the model which leads actually to everything being parsed.
Re: Performance in scoping [message #1037743 is a reply to message #1037543] Tue, 09 April 2013 20:43 Go to previous messageGo to next message
paul lu is currently offline paul lu
Messages: 14
Registered: April 2013
Junior Member
Hi,
Thanks a lot Smile
It seems very promising !
Re: Performance in scoping [message #1037760 is a reply to message #1037743] Tue, 09 April 2013 21:20 Go to previous messageGo to next message
Steve Kallestad is currently offline Steve Kallestad
Messages: 62
Registered: March 2013
Member
Hey Paul - one gotcha with that... if you're dependent on the userData in your IEObjectDescriptions for objects defined within the current editor, you need to add that data in your MyDSLImportedNamespaceAwareLocalScopeProvider as well.

Local IEObjectDescriptions are built by the ImportedNamespaceAwareLocalScopeProvider. Imported files are built by the ResourceDescriptionStrategy. Add the appropriate userData in both and everything should look the same no matter where it comes from.

Binding a custom LocalScopeProvider was a little tricky for me. In the RuntimeModule, add:
    @Override
    	public void configureIScopeProviderDelegate(Binder binder) {
    	binder.bind(org.eclipse.xtext.scoping.IScopeProvider.class)
    	.annotatedWith(
    			com.google.inject.name.Names.named(org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider.NAMED_DELEGATE)).to(MyDSLImportedNamespaceAwareLocalScopeProvider.class);	
    	}
Re: Performance in scoping [message #1037778 is a reply to message #1037760] Tue, 09 April 2013 21:58 Go to previous message
paul lu is currently offline paul lu
Messages: 14
Registered: April 2013
Junior Member

Thank you Steve,
for the advice Smile
Previous Topic:Unresolvable proxies
Next Topic:Support for refactoring in EmbeddedEditor
Goto Forum:
  


Current Time: Thu Jul 24 09:03:06 EDT 2014

Powered by FUDForum. Page generated in 0.16322 seconds