SlideShare a Scribd company logo
Xtext beyond the defaults
How to tackle performance problems
Who is that guy?
Xtext defaults are a good start!
But one size does not fit all!
Xtext defaults are a good start!
But one size does not fit all!
Amount of DSLs increases
Xtext defaults are a good start!
But one size does not fit all!
Amount of DSLs increases
Files get bigger
Xtext defaults are a good start!
But one size does not fit all!
Amount of DSLs increases
Files get bigger
Amount of files increases
Xtext defaults are a good start!
But one size does not fit all!
Amount of DSLs increases
Files get bigger
Amount of files increases
Many cross references
Xtext defaults are a good start!
But one size does not fit all!
Amount of DSLs increases
Files get bigger
Amount of files increases
Many cross references
Maybe transitive cross references…
Look what we have build!
Look what we have build!
More than 20 DSLs…
Look what we have build!
More than 20 DSLs…
and 200.000 lines in one file…
Look what we have build!
More than 20 DSLs…
and 200.000 lines in one file…
and we can check in broken models…
Look what we have build!
More than 20 DSLs…
and 200.000 lines in one file…
and we can check in broken models…
and we generate the missing stuff…
Look what we have build!
More than 20 DSLs…
and 200.000 lines in one file…
and we can check in broken models…
and we generate the missing stuff…
to make them valid again!
Look what we have build!
More than 20 DSLs…
and 200.000 lines in one file…
We are on Xtext 2.6.2 and can’t update!
and we can check in broken models…
and we generate the missing stuff…
to make them valid again!
Look what we have build!
More than 20 DSLs…
and 200.000 lines in one file…
We are on Xtext 2.6.2 and can’t update!
and we can check in broken models…
and we generate the missing stuff…
to make them valid again!
Could you please back-port the changes?
Everything is sooo slow!!!
Xtext sucks!!!
Finally think about improving the situation!
Update to newest Xtext Version
2.10.x
Update to newest Xtext Version
2.10.x
Xtext 2.11
released
early
2017
Why should I update???
Because…we killed bugs…
Because…we killed bugs…
Let workarounds
not last forever!
…Speed…
…Speed…
Resolving
cross-
references
has
never
been
faster…
…new features…
…new features…
Make
Xtext work
with
other
platform
s
…let’s work together.
…let’s work together.
It was
never
easier
to
contribute!
We
are
on
G
ithub
:-D
What about Performance…
Most problems happen in…
…Index and scoping…
…Memory consumption.
Validations…
… Complex generators…
I need Xbase in every language…
I need Xbase in every language…
… because my language is
complicated…
I need Xbase in every language…
… because my language is
complicated…
… no I can’t explain why…
I need Xbase in every language…
… because my language is
complicated…
… no I can’t explain why…
… but there is this small corner case…
Is a FAST validation really fast…
Is a FAST validation really fast…
… it’s triggered every time I stop typing
Scoping is sooo complicated…
Scoping is sooo complicated…
… I heard that in nearly every project…
Scoping is sooo complicated…
… I heard that in nearly every project…
…and people stop improving things when
it work’s for the first time…
Scoping is sooo complicated…
… I heard that in nearly every project…
…and people stop improving things when
it work’s for the first time…
… code is not touched any more because
who knows…
Scoping is sooo complicated…
… I heard that in nearly every project…
…and people stop improving things when
it work’s for the first time…
… code is not touched any more because
who knows…
… it worked before you touched it!
What’s the problem?
LocalScope
GlobalScope
ImportScopeTypeScope
Caches everywhere
The Index
Lazylinking
EcoreUtils.resolveAll should do the trick!
DerivedState
ContainerState
BatchLinkableResource
Scoping API
scope_Element_feature(Element element ,EReference ref)
Scoping API
scope_Element_feature(Element element ,EReference ref)
Scoping API
scope_Element_feature(Element element ,EReference ref)
Scoping API
scope_Element_feature(Element element ,EReference ref)
Scoping API
scope_Element_feature(Element element ,EReference ref)
Called by the PolymorphicDispatcher…
Scoping API
scope_Element_feature(Element element ,EReference ref)
Called by the PolymorphicDispatcher…
…in a reflective way…
Scoping API
scope_Element_feature(Element element ,EReference ref)
Called by the PolymorphicDispatcher…
and if grammar changed it might not get called any more…
…in a reflective way…
Scoping API
scope_Element_feature(Element element ,EReference ref)
Called by the PolymorphicDispatcher…
and if grammar changed it might not get called any more…
…in a reflective way…
…BECAUSE IT’S SLOW!
Scoping API
scope_Element_feature(Element element ,EReference ref)
Called by the PolymorphicDispatcher…
and if grammar changed it might not get called any more…
…in a reflective way…
…BECAUSE IT’S SLOW!
Implement
getScope(EObject context, EReference ref)
if(context instanceof Element && ref ==
MyPackage.Literals.ELEMENT_FEATURE)
up to 10 %
Scoping API
scope_Element_feature(Element element ,EReference ref)
Called by the PolymorphicDispatcher…
and if grammar changed it might not get called any more…
…in a reflective way…
…BECAUSE IT’S SLOW!
Implement
getScope(EObject context, EReference ref)
if(context instanceof Element && ref ==
MyPackage.Literals.ELEMENT_FEATURE)
up to 10 %Will not work
with
Xbase
anyway…
Use caches in the ScopeProvider
Use caches in the ScopeProvider
For each cross reference the ScopeProvider gets asked…
Use caches in the ScopeProvider
…and it calculates the very same stuff
over and over again…
For each cross reference the ScopeProvider gets asked…
Use caches in the ScopeProvider
…and it calculates the very same stuff
over and over again…
For each cross reference the ScopeProvider gets asked…
…cache the calculated stuff and invalidate it when
necessary!
Use caches in the ScopeProvider
…and it calculates the very same stuff
over and over again…
For each cross reference the ScopeProvider gets asked…
…cache the calculated stuff and invalidate it when
necessary!
The cache of the GlobalScope should be the index and
nothing else!
Use the force of the Index
Use the force of the Index
Holds all lightweight representations of
referenceable elements and their resources
Use the force of the Index
Holds all lightweight representations of
referenceable elements and their resources
It’s a HashMap…
It’s super fast since Xtext 2.x
and improved further
Holds all lightweight representations of
referenceable elements and their resources
Use the force of the Index
It’s a HashMap…
It’s super fast since Xtext 2.x
and improved further
It’s YOUR Index - you can put data in…!
Index - how to feed it
Index - how to feed it
1. Builder picks up DSL files and loads them one by one
Index - how to feed it
1. Builder picks up DSL files and loads them one by one
2. Creates ResourceDescriptions through ResourceDescriptionManager
Index - how to feed it
1. Builder picks up DSL files and loads them one by one
2. Creates ResourceDescriptions through ResourceDescriptionManager
3. ResourceDescriptionManager calls ResourceDescriptionsStrategy to
create EObjectDescriptions
Index - how to feed it
1. Builder picks up DSL files and loads them one by one
2. Creates ResourceDescriptions through ResourceDescriptionManager
3. ResourceDescriptionManager calls ResourceDescriptionsStrategy to
create EObjectDescriptions
You have to bind a custom impl for the ResourceDescriptionsStrategy in
the RuntimeModule
Index - how to feed it
1. Builder picks up DSL files and loads them one by one
2. Creates ResourceDescriptions through ResourceDescriptionManager
3. ResourceDescriptionManager calls ResourceDescriptionsStrategy to
create EObjectDescriptions
You have to bind a custom impl for the ResourceDescriptionsStrategy in
the RuntimeModule
The default creates a EObjectDescription for
EVERY Element that has a name…
IEObjectDescription create(String simpleName, EObject element, Map<String, String> userData)
Information hiding and userData
IEObjectDescription create(String simpleName, EObject element, Map<String, String> userData)
Information hiding and userData
IEObjectDescription create(String simpleName, EObject element, Map<String, String> userData)
Information hiding and userData
IEObjectDescription create(String simpleName, EObject element, Map<String, String> userData)
Information hiding and userData
Save memory & time
UserData - what for?
UserData - what for?
Validation
Don’t load the world to get informations - put
them in the index
UserData - what for?
Validation
Don’t load the world to get informations - put
them in the index
Scoping
Don’t resolve proxies for simple informations
Reference non Xtext models
Reference non Xtext models
We have our own GlobalScopeProvider that does the trick…
Reference non Xtext models
We have our own GlobalScopeProvider that does the trick…
…we load everything and the GlobalScope contains the
corresponding EObjectDescriptions…
Reference non Xtext models
We have our own GlobalScopeProvider that does the trick…
…we load everything and the GlobalScope contains the
corresponding EObjectDescriptions…
…but it’s slow and we cannot navigate those elements in the
editor…
You can do better…
Reuse the Xtext infrastructure
Reuse the Xtext infrastructure
Bind a ResourceServiceProvider…
…so that you can put the elements in the index and make
them navigable!
Reuse the Xtext infrastructure
Bind a ResourceServiceProvider…
…so that you can put the elements in the index and make
them navigable!
GenericResourceServiceProvider
Use
It will put everything that has a name in the index…
… introduce your own ResourceDescriptionStrategy!
But the builder picks them up…
and it takes ages!
Put the index in the jar
Put the index in the jar
Why calculating the index of a static set of files?
Put the index in the jar
The index is serialisable…
…put it in the jar and load it.
Why calculating the index of a static set of files?
Index in Standalone
It’s sooo slow…
Index in Standalone
It’s sooo slow…
…of course I have my custom Standalone impl…
Index in Standalone
ResourceSetGlobalScopeProvider
Long time the
was the default.
Index in Standalone
ResourceSetGlobalScopeProvider
Long time the
was the default.
Today we can do better but you need to use it and know that
there is something new…
For Maven- and Gradleplugin it’s done.
Index in Standalone
Fill the index and install it on the ResourceSet!
Load each resource and ask the ResourceDescriptionManager
to create a ResourceDescription…
Index in Standalone
Fill the index and install it on the ResourceSet!
Load each resource and ask the ResourceDescriptionManager
to create a ResourceDescription…
Install it on the ResourceSet
Make big things run again and save your ass!
Up to 80% more faster in 10 minutes!
Codegenerators
They are sooo slow…
Codegenerators
They are sooo slow…
… of course I am using mwe2 to invoke it…
Codegenerators
They are sooo slow…
… of course I am using mwe2 to invoke it…
… even in the IDE!
Incremental generators
Incremental generators
The builder triggers the generator for each resource…
Incremental generators
The builder triggers the generator for each resource…
…when a file changes the builder computes the impact and
retriggers the generator for each affected file!
Incremental generators
The builder triggers the generator for each resource…
…when a file changes the builder computes the impact and
retriggers the generator for each affected file!
What about m:n scenarios?
Solveable with a little effort - but it is worth the work!
Incremental generators
The builder triggers the generator for each resource…
…when a file changes the builder computes the impact and
retriggers the generator for each affected file!
What about m:n scenarios?
Solveable with a little effort - but it is worth the work!
There is a ParallelBuilderParticipant…
…you have to bind it for your language…
… make sure all proxies are already resolved!
Memory consumption
Memory consumption
DisabledClusteringPolicy
Do not unload resource…
Memory consumption
DisabledClusteringPolicy
DynamicResourceClusteringPolicy
Do not unload resource…
Unload resources when there is no free memory…
…can be configured.
The NodeModel is huge
Stores the syntax tree with text and positions…
The NodeModel is huge
Stores the syntax tree with text and positions…
…is used to get the position of a specific element or
feature…
The NodeModel is huge
Stores the syntax tree with text and positions…
…is used to get the position of a specific element or
feature…
…produces a lot of Strings in memory…
The NodeModel is huge
Stores the syntax tree with text and positions…
…is used to get the position of a specific element or
feature…
…produces a lot of Strings in memory…
…and during the builder runs you do not really need
it.
Switch off the NodeModel
Switch off the NodeModel
The parser creates it …
Switch off the NodeModel
The parser creates it …
…it is used to install proxies - so you have to do that
differently…
Switch off the NodeModel
The parser creates it …
…it is used to install proxies - so you have to do that
differently…
You want to have it when the editor is used…
Switch off the NodeModel
The parser creates it …
…it is used to install proxies - so you have to do that
differently…
You want to have it when the editor is used…
… the load options should be an indicator…
Switch off the NodeModel
The parser creates it …
…it is used to install proxies - so you have to do that
differently…
You want to have it when the editor is used…
… the load options should be an indicator…
…what are the implications?
Implications
You cannot use the NodeModel in validations and
scoping any more…
Implications
You cannot use the NodeModel in validations and
scoping any more…
…Issues are marked at position 0,0…
…an EditorCallback should revalidate the content.
Implications
You cannot use the NodeModel in validations and
scoping any more…
…Issues are marked at position 0,0…
…an EditorCallback should revalidate the content.
THIS IS NOT A COMMON THING!
DO IT ONLY WHEN IT IS REALLY NECESSARY!
Order makes a difference
Order makes a difference
Files might belong together…
Order makes a difference
Files might belong together…
…and might reference each other.
Order makes a difference
Files might belong together…
…and might reference each other.
Putting them in an logical order for the builder…
Order makes a difference
Files might belong together…
…and might reference each other.
Putting them in an logical order for the builder…
… and they do not have be loaded more than once.
Order makes a difference
Files might belong together…
…and might reference each other.
Putting them in an logical order for the builder…
… and they do not have be loaded more than once.
Sometimes it makes sense to not unload them at all.
Now you know!
Professional Support
Xtext beyond the defaults -  how to tackle performance problems

More Related Content

What's hot

Using Xcore with Xtext
Using Xcore with XtextUsing Xcore with Xtext
Using Xcore with Xtext
Holger Schill
 
Node Architecture and Getting Started with Express
Node Architecture and Getting Started with ExpressNode Architecture and Getting Started with Express
Node Architecture and Getting Started with Express
jguerrero999
 
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
Edureka!
 
Lightweight Xtext Editors as SWT Widgets
Lightweight Xtext Editors as SWT WidgetsLightweight Xtext Editors as SWT Widgets
Lightweight Xtext Editors as SWT Widgets
meysholdt
 
C++ & VISUAL C++
C++ & VISUAL C++ C++ & VISUAL C++
C++ & VISUAL C++
Makaha Rutendo
 
Html 5 geolocation api
Html 5 geolocation api Html 5 geolocation api
Html 5 geolocation api
Muhammad Ehtisham Siddiqui
 
Node JS Crash Course
Node JS Crash CourseNode JS Crash Course
Node JS Crash Course
Haim Michael
 
Node.js Basics
Node.js Basics Node.js Basics
Node.js Basics
TheCreativedev Blog
 
Oop java
Oop javaOop java
Oop java
Minal Maniar
 
Introduction to Java Programming Language
Introduction to Java Programming LanguageIntroduction to Java Programming Language
Introduction to Java Programming Language
jaimefrozr
 
Find your own iOS kernel bug
Find your own iOS kernel bugFind your own iOS kernel bug
Find your own iOS kernel bug
Gustavo Martinez
 
Core java concepts
Core java  conceptsCore java  concepts
Core java concepts
Ram132
 
Sequence and Traverse - Part 2
Sequence and Traverse - Part 2Sequence and Traverse - Part 2
Sequence and Traverse - Part 2
Philip Schwarz
 
Java Basics
Java BasicsJava Basics
Java Basics
Brandon Black
 
Introduction to Hibernate Framework
Introduction to Hibernate FrameworkIntroduction to Hibernate Framework
Introduction to Hibernate Framework
Mohit Kanwar
 
Angular Pipes Workshop
Angular Pipes WorkshopAngular Pipes Workshop
Angular Pipes Workshop
Nir Kaufman
 
java tutorial for beginner - Free Download
java tutorial for beginner - Free Downloadjava tutorial for beginner - Free Download
java tutorial for beginner - Free Download
TIB Academy
 
Type script - advanced usage and practices
Type script  - advanced usage and practicesType script  - advanced usage and practices
Type script - advanced usage and practices
Iwan van der Kleijn
 
Intrinsic Methods in HotSpot VM
Intrinsic Methods in HotSpot VMIntrinsic Methods in HotSpot VM
Intrinsic Methods in HotSpot VM
Kris Mok
 

What's hot (20)

Using Xcore with Xtext
Using Xcore with XtextUsing Xcore with Xtext
Using Xcore with Xtext
 
Node Architecture and Getting Started with Express
Node Architecture and Getting Started with ExpressNode Architecture and Getting Started with Express
Node Architecture and Getting Started with Express
 
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
 
Lightweight Xtext Editors as SWT Widgets
Lightweight Xtext Editors as SWT WidgetsLightweight Xtext Editors as SWT Widgets
Lightweight Xtext Editors as SWT Widgets
 
Wpf Introduction
Wpf IntroductionWpf Introduction
Wpf Introduction
 
C++ & VISUAL C++
C++ & VISUAL C++ C++ & VISUAL C++
C++ & VISUAL C++
 
Html 5 geolocation api
Html 5 geolocation api Html 5 geolocation api
Html 5 geolocation api
 
Node JS Crash Course
Node JS Crash CourseNode JS Crash Course
Node JS Crash Course
 
Node.js Basics
Node.js Basics Node.js Basics
Node.js Basics
 
Oop java
Oop javaOop java
Oop java
 
Introduction to Java Programming Language
Introduction to Java Programming LanguageIntroduction to Java Programming Language
Introduction to Java Programming Language
 
Find your own iOS kernel bug
Find your own iOS kernel bugFind your own iOS kernel bug
Find your own iOS kernel bug
 
Core java concepts
Core java  conceptsCore java  concepts
Core java concepts
 
Sequence and Traverse - Part 2
Sequence and Traverse - Part 2Sequence and Traverse - Part 2
Sequence and Traverse - Part 2
 
Java Basics
Java BasicsJava Basics
Java Basics
 
Introduction to Hibernate Framework
Introduction to Hibernate FrameworkIntroduction to Hibernate Framework
Introduction to Hibernate Framework
 
Angular Pipes Workshop
Angular Pipes WorkshopAngular Pipes Workshop
Angular Pipes Workshop
 
java tutorial for beginner - Free Download
java tutorial for beginner - Free Downloadjava tutorial for beginner - Free Download
java tutorial for beginner - Free Download
 
Type script - advanced usage and practices
Type script  - advanced usage and practicesType script  - advanced usage and practices
Type script - advanced usage and practices
 
Intrinsic Methods in HotSpot VM
Intrinsic Methods in HotSpot VMIntrinsic Methods in HotSpot VM
Intrinsic Methods in HotSpot VM
 

Viewers also liked

From Stairway to Heaven onto the Highway to Hell with Xtext
From Stairway to Heaven onto the Highway to Hell with XtextFrom Stairway to Heaven onto the Highway to Hell with Xtext
From Stairway to Heaven onto the Highway to Hell with Xtext
Karsten Thoms
 
Building Your Own DSL with Xtext
Building Your Own DSL with XtextBuilding Your Own DSL with Xtext
Building Your Own DSL with Xtext
GlobalLogic Ukraine
 
Code Generation idioms with Xtend
Code Generation idioms with XtendCode Generation idioms with Xtend
Code Generation idioms with Xtend
Holger Schill
 
Introduction to Xbase
Introduction to XbaseIntroduction to Xbase
Introduction to Xbase
Holger Schill
 
The Xtext Grammar Language
The Xtext Grammar LanguageThe Xtext Grammar Language
The Xtext Grammar Language
Dr. Jan Köhnlein
 
Recipes to build Code Generators for Non-Xtext Models with Xtend
Recipes to build Code Generators for Non-Xtext Models with XtendRecipes to build Code Generators for Non-Xtext Models with Xtend
Recipes to build Code Generators for Non-Xtext Models with Xtend
Karsten Thoms
 
EMF - Beyond The Basics
EMF - Beyond The BasicsEMF - Beyond The Basics
EMF - Beyond The Basics
Dr. Jan Köhnlein
 
EMF Tips n Tricks
EMF Tips n TricksEMF Tips n Tricks
EMF Tips n Tricks
Kaniska Mandal
 
Xtend - A Language Made for Java Developers
Xtend - A Language Made for Java DevelopersXtend - A Language Made for Java Developers
Xtend - A Language Made for Java Developers
Sebastian Zarnekow
 
DSLs for Java Developers
DSLs for Java DevelopersDSLs for Java Developers
DSLs for Java Developers
Dr. Jan Köhnlein
 
Graphical Views For Xtext With FXDiagram
Graphical Views For Xtext With FXDiagramGraphical Views For Xtext With FXDiagram
Graphical Views For Xtext With FXDiagram
Dr. Jan Köhnlein
 
Jazoon 2010 - Building DSLs with Eclipse
Jazoon 2010 - Building DSLs with EclipseJazoon 2010 - Building DSLs with Eclipse
Jazoon 2010 - Building DSLs with Eclipse
Peter Friese
 
Graphical Views For Xtext
Graphical Views For XtextGraphical Views For Xtext
Graphical Views For Xtext
Dr. Jan Köhnlein
 
Eclipse DemoCamp in Paris: Language Development with Xtext
Eclipse DemoCamp in Paris: Language Development with XtextEclipse DemoCamp in Paris: Language Development with Xtext
Eclipse DemoCamp in Paris: Language Development with XtextSebastian Zarnekow
 
Enhancing Xtext for General Purpose Languages
Enhancing Xtext for General Purpose LanguagesEnhancing Xtext for General Purpose Languages
Enhancing Xtext for General Purpose Languages
University of York
 
ARText - Driving Developments with Xtext
ARText - Driving Developments with XtextARText - Driving Developments with Xtext
ARText - Driving Developments with XtextSebastian Benz
 
Xtext, diagrams and ux
Xtext, diagrams and uxXtext, diagrams and ux
Xtext, diagrams and ux
Dr. Jan Köhnlein
 
What's Cooking in Xtext 2.0
What's Cooking in Xtext 2.0What's Cooking in Xtext 2.0
What's Cooking in Xtext 2.0
Dr. Jan Köhnlein
 
Language Engineering With Xtext
Language Engineering With XtextLanguage Engineering With Xtext
Language Engineering With Xtext
Sven Efftinge
 
Scoping Tips and Tricks
Scoping Tips and TricksScoping Tips and Tricks
Scoping Tips and Tricks
Sebastian Zarnekow
 

Viewers also liked (20)

From Stairway to Heaven onto the Highway to Hell with Xtext
From Stairway to Heaven onto the Highway to Hell with XtextFrom Stairway to Heaven onto the Highway to Hell with Xtext
From Stairway to Heaven onto the Highway to Hell with Xtext
 
Building Your Own DSL with Xtext
Building Your Own DSL with XtextBuilding Your Own DSL with Xtext
Building Your Own DSL with Xtext
 
Code Generation idioms with Xtend
Code Generation idioms with XtendCode Generation idioms with Xtend
Code Generation idioms with Xtend
 
Introduction to Xbase
Introduction to XbaseIntroduction to Xbase
Introduction to Xbase
 
The Xtext Grammar Language
The Xtext Grammar LanguageThe Xtext Grammar Language
The Xtext Grammar Language
 
Recipes to build Code Generators for Non-Xtext Models with Xtend
Recipes to build Code Generators for Non-Xtext Models with XtendRecipes to build Code Generators for Non-Xtext Models with Xtend
Recipes to build Code Generators for Non-Xtext Models with Xtend
 
EMF - Beyond The Basics
EMF - Beyond The BasicsEMF - Beyond The Basics
EMF - Beyond The Basics
 
EMF Tips n Tricks
EMF Tips n TricksEMF Tips n Tricks
EMF Tips n Tricks
 
Xtend - A Language Made for Java Developers
Xtend - A Language Made for Java DevelopersXtend - A Language Made for Java Developers
Xtend - A Language Made for Java Developers
 
DSLs for Java Developers
DSLs for Java DevelopersDSLs for Java Developers
DSLs for Java Developers
 
Graphical Views For Xtext With FXDiagram
Graphical Views For Xtext With FXDiagramGraphical Views For Xtext With FXDiagram
Graphical Views For Xtext With FXDiagram
 
Jazoon 2010 - Building DSLs with Eclipse
Jazoon 2010 - Building DSLs with EclipseJazoon 2010 - Building DSLs with Eclipse
Jazoon 2010 - Building DSLs with Eclipse
 
Graphical Views For Xtext
Graphical Views For XtextGraphical Views For Xtext
Graphical Views For Xtext
 
Eclipse DemoCamp in Paris: Language Development with Xtext
Eclipse DemoCamp in Paris: Language Development with XtextEclipse DemoCamp in Paris: Language Development with Xtext
Eclipse DemoCamp in Paris: Language Development with Xtext
 
Enhancing Xtext for General Purpose Languages
Enhancing Xtext for General Purpose LanguagesEnhancing Xtext for General Purpose Languages
Enhancing Xtext for General Purpose Languages
 
ARText - Driving Developments with Xtext
ARText - Driving Developments with XtextARText - Driving Developments with Xtext
ARText - Driving Developments with Xtext
 
Xtext, diagrams and ux
Xtext, diagrams and uxXtext, diagrams and ux
Xtext, diagrams and ux
 
What's Cooking in Xtext 2.0
What's Cooking in Xtext 2.0What's Cooking in Xtext 2.0
What's Cooking in Xtext 2.0
 
Language Engineering With Xtext
Language Engineering With XtextLanguage Engineering With Xtext
Language Engineering With Xtext
 
Scoping Tips and Tricks
Scoping Tips and TricksScoping Tips and Tricks
Scoping Tips and Tricks
 

Similar to Xtext beyond the defaults - how to tackle performance problems

Language Server Protocol - Why the Hype?
Language Server Protocol - Why the Hype?Language Server Protocol - Why the Hype?
Language Server Protocol - Why the Hype?
mikaelbarbero
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBJustin Smestad
 
Streams of information - Chicago crystal language monthly meetup
Streams of information - Chicago crystal language monthly meetupStreams of information - Chicago crystal language monthly meetup
Streams of information - Chicago crystal language monthly meetup
Brian Cardiff
 
Write code that writes code!
Write code that writes code!Write code that writes code!
Write code that writes code!
Jason Feinstein
 
Write code that writes code! A beginner's guide to Annotation Processing - Ja...
Write code that writes code! A beginner's guide to Annotation Processing - Ja...Write code that writes code! A beginner's guide to Annotation Processing - Ja...
Write code that writes code! A beginner's guide to Annotation Processing - Ja...
DroidConTLV
 
Writing a REST Interconnection Library in Swift
Writing a REST Interconnection Library in SwiftWriting a REST Interconnection Library in Swift
Writing a REST Interconnection Library in Swift
Pablo Villar
 
Elasticsearch Basics
Elasticsearch BasicsElasticsearch Basics
Elasticsearch Basics
Shifa Khan
 
ElasticSearch - index server used as a document database
ElasticSearch - index server used as a document databaseElasticSearch - index server used as a document database
ElasticSearch - index server used as a document database
Robert Lujo
 
The State of Wicket
The State of WicketThe State of Wicket
The State of Wicket
Martijn Dashorst
 
Development workflow
Development workflowDevelopment workflow
Development workflowSigsiu.NET
 
GWT is Smarter Than You
GWT is Smarter Than YouGWT is Smarter Than You
GWT is Smarter Than You
Robert Cooper
 
Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)
Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)
Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)Apigee | Google Cloud
 
How it's made - MyGet (CloudBurst)
How it's made - MyGet (CloudBurst)How it's made - MyGet (CloudBurst)
How it's made - MyGet (CloudBurst)
Maarten Balliauw
 
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
Maarten Balliauw
 
The Ember.js Framework - Everything You Need To Know
The Ember.js Framework - Everything You Need To KnowThe Ember.js Framework - Everything You Need To Know
The Ember.js Framework - Everything You Need To Know
All Things Open
 
AMD - Why, What and How
AMD - Why, What and HowAMD - Why, What and How
AMD - Why, What and How
Mike Wilcox
 
NoSQL: Why, When, and How
NoSQL: Why, When, and HowNoSQL: Why, When, and How
NoSQL: Why, When, and HowBigBlueHat
 
Nuxeo Platform 6.0 - What's New - November 2014
Nuxeo Platform 6.0 - What's New - November 2014Nuxeo Platform 6.0 - What's New - November 2014
Nuxeo Platform 6.0 - What's New - November 2014
Nuxeo
 

Similar to Xtext beyond the defaults - how to tackle performance problems (20)

Language Server Protocol - Why the Hype?
Language Server Protocol - Why the Hype?Language Server Protocol - Why the Hype?
Language Server Protocol - Why the Hype?
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Streams of information - Chicago crystal language monthly meetup
Streams of information - Chicago crystal language monthly meetupStreams of information - Chicago crystal language monthly meetup
Streams of information - Chicago crystal language monthly meetup
 
Write code that writes code!
Write code that writes code!Write code that writes code!
Write code that writes code!
 
Write code that writes code! A beginner's guide to Annotation Processing - Ja...
Write code that writes code! A beginner's guide to Annotation Processing - Ja...Write code that writes code! A beginner's guide to Annotation Processing - Ja...
Write code that writes code! A beginner's guide to Annotation Processing - Ja...
 
Writing a REST Interconnection Library in Swift
Writing a REST Interconnection Library in SwiftWriting a REST Interconnection Library in Swift
Writing a REST Interconnection Library in Swift
 
Elasticsearch Basics
Elasticsearch BasicsElasticsearch Basics
Elasticsearch Basics
 
ElasticSearch - index server used as a document database
ElasticSearch - index server used as a document databaseElasticSearch - index server used as a document database
ElasticSearch - index server used as a document database
 
The State of Wicket
The State of WicketThe State of Wicket
The State of Wicket
 
Play framework
Play frameworkPlay framework
Play framework
 
DSLs in JavaScript
DSLs in JavaScriptDSLs in JavaScript
DSLs in JavaScript
 
Development workflow
Development workflowDevelopment workflow
Development workflow
 
GWT is Smarter Than You
GWT is Smarter Than YouGWT is Smarter Than You
GWT is Smarter Than You
 
Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)
Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)
Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)
 
How it's made - MyGet (CloudBurst)
How it's made - MyGet (CloudBurst)How it's made - MyGet (CloudBurst)
How it's made - MyGet (CloudBurst)
 
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
 
The Ember.js Framework - Everything You Need To Know
The Ember.js Framework - Everything You Need To KnowThe Ember.js Framework - Everything You Need To Know
The Ember.js Framework - Everything You Need To Know
 
AMD - Why, What and How
AMD - Why, What and HowAMD - Why, What and How
AMD - Why, What and How
 
NoSQL: Why, When, and How
NoSQL: Why, When, and HowNoSQL: Why, When, and How
NoSQL: Why, When, and How
 
Nuxeo Platform 6.0 - What's New - November 2014
Nuxeo Platform 6.0 - What's New - November 2014Nuxeo Platform 6.0 - What's New - November 2014
Nuxeo Platform 6.0 - What's New - November 2014
 

Recently uploaded

NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
ankuprajapati0525
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
Vijay Dialani, PhD
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
WENKENLI1
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
BrazilAccount1
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
Pipe Restoration Solutions
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
FluxPrime1
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 

Recently uploaded (20)

NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 

Xtext beyond the defaults - how to tackle performance problems

  • 1. Xtext beyond the defaults How to tackle performance problems
  • 2. Who is that guy?
  • 3.
  • 4.
  • 5.
  • 6.
  • 7. Xtext defaults are a good start! But one size does not fit all!
  • 8. Xtext defaults are a good start! But one size does not fit all! Amount of DSLs increases
  • 9. Xtext defaults are a good start! But one size does not fit all! Amount of DSLs increases Files get bigger
  • 10. Xtext defaults are a good start! But one size does not fit all! Amount of DSLs increases Files get bigger Amount of files increases
  • 11. Xtext defaults are a good start! But one size does not fit all! Amount of DSLs increases Files get bigger Amount of files increases Many cross references
  • 12. Xtext defaults are a good start! But one size does not fit all! Amount of DSLs increases Files get bigger Amount of files increases Many cross references Maybe transitive cross references…
  • 13. Look what we have build!
  • 14. Look what we have build! More than 20 DSLs…
  • 15. Look what we have build! More than 20 DSLs… and 200.000 lines in one file…
  • 16. Look what we have build! More than 20 DSLs… and 200.000 lines in one file… and we can check in broken models…
  • 17. Look what we have build! More than 20 DSLs… and 200.000 lines in one file… and we can check in broken models… and we generate the missing stuff…
  • 18. Look what we have build! More than 20 DSLs… and 200.000 lines in one file… and we can check in broken models… and we generate the missing stuff… to make them valid again!
  • 19. Look what we have build! More than 20 DSLs… and 200.000 lines in one file… We are on Xtext 2.6.2 and can’t update! and we can check in broken models… and we generate the missing stuff… to make them valid again!
  • 20. Look what we have build! More than 20 DSLs… and 200.000 lines in one file… We are on Xtext 2.6.2 and can’t update! and we can check in broken models… and we generate the missing stuff… to make them valid again! Could you please back-port the changes?
  • 21. Everything is sooo slow!!! Xtext sucks!!!
  • 22. Finally think about improving the situation!
  • 23. Update to newest Xtext Version 2.10.x
  • 24. Update to newest Xtext Version 2.10.x Xtext 2.11 released early 2017
  • 25. Why should I update???
  • 27. Because…we killed bugs… Let workarounds not last forever!
  • 33. …let’s work together. It was never easier to contribute! We are on G ithub :-D
  • 35. Most problems happen in… …Index and scoping… …Memory consumption. Validations… … Complex generators…
  • 36. I need Xbase in every language…
  • 37. I need Xbase in every language… … because my language is complicated…
  • 38. I need Xbase in every language… … because my language is complicated… … no I can’t explain why…
  • 39. I need Xbase in every language… … because my language is complicated… … no I can’t explain why… … but there is this small corner case…
  • 40. Is a FAST validation really fast…
  • 41. Is a FAST validation really fast… … it’s triggered every time I stop typing
  • 42. Scoping is sooo complicated…
  • 43. Scoping is sooo complicated… … I heard that in nearly every project…
  • 44. Scoping is sooo complicated… … I heard that in nearly every project… …and people stop improving things when it work’s for the first time…
  • 45. Scoping is sooo complicated… … I heard that in nearly every project… …and people stop improving things when it work’s for the first time… … code is not touched any more because who knows…
  • 46. Scoping is sooo complicated… … I heard that in nearly every project… …and people stop improving things when it work’s for the first time… … code is not touched any more because who knows… … it worked before you touched it!
  • 47. What’s the problem? LocalScope GlobalScope ImportScopeTypeScope Caches everywhere The Index Lazylinking EcoreUtils.resolveAll should do the trick! DerivedState ContainerState BatchLinkableResource
  • 52. Scoping API scope_Element_feature(Element element ,EReference ref) Called by the PolymorphicDispatcher…
  • 53. Scoping API scope_Element_feature(Element element ,EReference ref) Called by the PolymorphicDispatcher… …in a reflective way…
  • 54. Scoping API scope_Element_feature(Element element ,EReference ref) Called by the PolymorphicDispatcher… and if grammar changed it might not get called any more… …in a reflective way…
  • 55. Scoping API scope_Element_feature(Element element ,EReference ref) Called by the PolymorphicDispatcher… and if grammar changed it might not get called any more… …in a reflective way… …BECAUSE IT’S SLOW!
  • 56. Scoping API scope_Element_feature(Element element ,EReference ref) Called by the PolymorphicDispatcher… and if grammar changed it might not get called any more… …in a reflective way… …BECAUSE IT’S SLOW! Implement getScope(EObject context, EReference ref) if(context instanceof Element && ref == MyPackage.Literals.ELEMENT_FEATURE) up to 10 %
  • 57. Scoping API scope_Element_feature(Element element ,EReference ref) Called by the PolymorphicDispatcher… and if grammar changed it might not get called any more… …in a reflective way… …BECAUSE IT’S SLOW! Implement getScope(EObject context, EReference ref) if(context instanceof Element && ref == MyPackage.Literals.ELEMENT_FEATURE) up to 10 %Will not work with Xbase anyway…
  • 58. Use caches in the ScopeProvider
  • 59. Use caches in the ScopeProvider For each cross reference the ScopeProvider gets asked…
  • 60. Use caches in the ScopeProvider …and it calculates the very same stuff over and over again… For each cross reference the ScopeProvider gets asked…
  • 61. Use caches in the ScopeProvider …and it calculates the very same stuff over and over again… For each cross reference the ScopeProvider gets asked… …cache the calculated stuff and invalidate it when necessary!
  • 62. Use caches in the ScopeProvider …and it calculates the very same stuff over and over again… For each cross reference the ScopeProvider gets asked… …cache the calculated stuff and invalidate it when necessary! The cache of the GlobalScope should be the index and nothing else!
  • 63. Use the force of the Index
  • 64. Use the force of the Index Holds all lightweight representations of referenceable elements and their resources
  • 65. Use the force of the Index Holds all lightweight representations of referenceable elements and their resources It’s a HashMap… It’s super fast since Xtext 2.x and improved further
  • 66. Holds all lightweight representations of referenceable elements and their resources Use the force of the Index It’s a HashMap… It’s super fast since Xtext 2.x and improved further It’s YOUR Index - you can put data in…!
  • 67. Index - how to feed it
  • 68. Index - how to feed it 1. Builder picks up DSL files and loads them one by one
  • 69. Index - how to feed it 1. Builder picks up DSL files and loads them one by one 2. Creates ResourceDescriptions through ResourceDescriptionManager
  • 70. Index - how to feed it 1. Builder picks up DSL files and loads them one by one 2. Creates ResourceDescriptions through ResourceDescriptionManager 3. ResourceDescriptionManager calls ResourceDescriptionsStrategy to create EObjectDescriptions
  • 71. Index - how to feed it 1. Builder picks up DSL files and loads them one by one 2. Creates ResourceDescriptions through ResourceDescriptionManager 3. ResourceDescriptionManager calls ResourceDescriptionsStrategy to create EObjectDescriptions You have to bind a custom impl for the ResourceDescriptionsStrategy in the RuntimeModule
  • 72. Index - how to feed it 1. Builder picks up DSL files and loads them one by one 2. Creates ResourceDescriptions through ResourceDescriptionManager 3. ResourceDescriptionManager calls ResourceDescriptionsStrategy to create EObjectDescriptions You have to bind a custom impl for the ResourceDescriptionsStrategy in the RuntimeModule The default creates a EObjectDescription for EVERY Element that has a name…
  • 73. IEObjectDescription create(String simpleName, EObject element, Map<String, String> userData) Information hiding and userData
  • 74. IEObjectDescription create(String simpleName, EObject element, Map<String, String> userData) Information hiding and userData
  • 75. IEObjectDescription create(String simpleName, EObject element, Map<String, String> userData) Information hiding and userData
  • 76. IEObjectDescription create(String simpleName, EObject element, Map<String, String> userData) Information hiding and userData Save memory & time
  • 78. UserData - what for? Validation Don’t load the world to get informations - put them in the index
  • 79. UserData - what for? Validation Don’t load the world to get informations - put them in the index Scoping Don’t resolve proxies for simple informations
  • 81. Reference non Xtext models We have our own GlobalScopeProvider that does the trick…
  • 82. Reference non Xtext models We have our own GlobalScopeProvider that does the trick… …we load everything and the GlobalScope contains the corresponding EObjectDescriptions…
  • 83. Reference non Xtext models We have our own GlobalScopeProvider that does the trick… …we load everything and the GlobalScope contains the corresponding EObjectDescriptions… …but it’s slow and we cannot navigate those elements in the editor… You can do better…
  • 84. Reuse the Xtext infrastructure
  • 85. Reuse the Xtext infrastructure Bind a ResourceServiceProvider… …so that you can put the elements in the index and make them navigable!
  • 86. Reuse the Xtext infrastructure Bind a ResourceServiceProvider… …so that you can put the elements in the index and make them navigable! GenericResourceServiceProvider Use It will put everything that has a name in the index… … introduce your own ResourceDescriptionStrategy!
  • 87. But the builder picks them up… and it takes ages!
  • 88. Put the index in the jar
  • 89. Put the index in the jar Why calculating the index of a static set of files?
  • 90. Put the index in the jar The index is serialisable… …put it in the jar and load it. Why calculating the index of a static set of files?
  • 92. Index in Standalone It’s sooo slow… …of course I have my custom Standalone impl…
  • 94. Index in Standalone ResourceSetGlobalScopeProvider Long time the was the default. Today we can do better but you need to use it and know that there is something new… For Maven- and Gradleplugin it’s done.
  • 95. Index in Standalone Fill the index and install it on the ResourceSet! Load each resource and ask the ResourceDescriptionManager to create a ResourceDescription…
  • 96. Index in Standalone Fill the index and install it on the ResourceSet! Load each resource and ask the ResourceDescriptionManager to create a ResourceDescription… Install it on the ResourceSet
  • 97. Make big things run again and save your ass! Up to 80% more faster in 10 minutes!
  • 99. Codegenerators They are sooo slow… … of course I am using mwe2 to invoke it…
  • 100. Codegenerators They are sooo slow… … of course I am using mwe2 to invoke it… … even in the IDE!
  • 102. Incremental generators The builder triggers the generator for each resource…
  • 103. Incremental generators The builder triggers the generator for each resource… …when a file changes the builder computes the impact and retriggers the generator for each affected file!
  • 104. Incremental generators The builder triggers the generator for each resource… …when a file changes the builder computes the impact and retriggers the generator for each affected file! What about m:n scenarios? Solveable with a little effort - but it is worth the work!
  • 105. Incremental generators The builder triggers the generator for each resource… …when a file changes the builder computes the impact and retriggers the generator for each affected file! What about m:n scenarios? Solveable with a little effort - but it is worth the work! There is a ParallelBuilderParticipant… …you have to bind it for your language… … make sure all proxies are already resolved!
  • 108. Memory consumption DisabledClusteringPolicy DynamicResourceClusteringPolicy Do not unload resource… Unload resources when there is no free memory… …can be configured.
  • 109. The NodeModel is huge Stores the syntax tree with text and positions…
  • 110. The NodeModel is huge Stores the syntax tree with text and positions… …is used to get the position of a specific element or feature…
  • 111. The NodeModel is huge Stores the syntax tree with text and positions… …is used to get the position of a specific element or feature… …produces a lot of Strings in memory…
  • 112. The NodeModel is huge Stores the syntax tree with text and positions… …is used to get the position of a specific element or feature… …produces a lot of Strings in memory… …and during the builder runs you do not really need it.
  • 113. Switch off the NodeModel
  • 114. Switch off the NodeModel The parser creates it …
  • 115. Switch off the NodeModel The parser creates it … …it is used to install proxies - so you have to do that differently…
  • 116. Switch off the NodeModel The parser creates it … …it is used to install proxies - so you have to do that differently… You want to have it when the editor is used…
  • 117. Switch off the NodeModel The parser creates it … …it is used to install proxies - so you have to do that differently… You want to have it when the editor is used… … the load options should be an indicator…
  • 118. Switch off the NodeModel The parser creates it … …it is used to install proxies - so you have to do that differently… You want to have it when the editor is used… … the load options should be an indicator… …what are the implications?
  • 119. Implications You cannot use the NodeModel in validations and scoping any more…
  • 120. Implications You cannot use the NodeModel in validations and scoping any more… …Issues are marked at position 0,0… …an EditorCallback should revalidate the content.
  • 121. Implications You cannot use the NodeModel in validations and scoping any more… …Issues are marked at position 0,0… …an EditorCallback should revalidate the content. THIS IS NOT A COMMON THING! DO IT ONLY WHEN IT IS REALLY NECESSARY!
  • 122. Order makes a difference
  • 123. Order makes a difference Files might belong together…
  • 124. Order makes a difference Files might belong together… …and might reference each other.
  • 125. Order makes a difference Files might belong together… …and might reference each other. Putting them in an logical order for the builder…
  • 126. Order makes a difference Files might belong together… …and might reference each other. Putting them in an logical order for the builder… … and they do not have be loaded more than once.
  • 127. Order makes a difference Files might belong together… …and might reference each other. Putting them in an logical order for the builder… … and they do not have be loaded more than once. Sometimes it makes sense to not unload them at all.