Skip to main content


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 10:02 Go to next message
paul lu is currently offline paul luFriend
Messages: 43
Registered: April 2013
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 17:34 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
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.


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Performance in scoping [message #1037743 is a reply to message #1037543] Wed, 10 April 2013 00:43 Go to previous messageGo to next message
paul lu is currently offline paul luFriend
Messages: 43
Registered: April 2013
Member
Hi,
Thanks a lot Smile
It seems very promising !
Re: Performance in scoping [message #1037760 is a reply to message #1037743] Wed, 10 April 2013 01:20 Go to previous messageGo to next message
Steve Kallestad is currently offline Steve KallestadFriend
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] Wed, 10 April 2013 01:58 Go to previous message
paul lu is currently offline paul luFriend
Messages: 43
Registered: April 2013
Member

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


Current Time: Thu Mar 28 09:33:17 GMT 2024

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

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

Back to the top