EMF-IncQuery presentation at TOOLS 2012
-
Upload
istvan-rath -
Category
Technology
-
view
1.369 -
download
3
description
Transcript of EMF-IncQuery presentation at TOOLS 2012
Budapest University of Technology and EconomicsFault Tolerant Systems Research Group
TOOLS Europe 2012Prague, Czech Republic, 2012. 05. 30.
Integrating Efficient Model Queries in State-of-the-art EMF Tools
Gábor Bergmann, Ábel Hegedüs, Ákos Horváth, István Ráth, Zoltán Ujhelyi and
Dániel Varró
Overview Introduction EMF-INCQUERY overview Transparent query integration Performance considerations Conclusion
MDE today
REQ
SD
IMP
TST
Modeling techniques
IDE
Integrated model-driven tools
Model-based early
analysis Architecture modeling,
DSMLsCode
generation, model-assisted development
Model-based test generation
MDE today
REQ
SD
IMP
TST
Modeling techniques
IDE - Eclipse
Eclipse Modeling Framework
A key problem of MDE Scalability vs. modeling tools
o Issues encountered by several industrial partners using tools based on the Eclipse Modeling Framework (EMF)
o Modeling scenarios can get really complex really quickly• Instance models of size 1-2M and beyond• Performance issues with model transformations and code
generators have an adverse effect on everyday development tasks
Scalability?o Complex
(meta)modelso Large instance modelso Complex query and manipulation scenarios
Recognized e.g. by AUTOSAR tool vendorshttp://wiki.eclipse.org/Auto_IWG_WP2
Focus: model queries Model queries: “a piece of code that retrieves a given set of the
model” Queries are at the heart of MDE
o Every model access/read is a (simple) queryo More complex: Views, content providerso Most complex: Model transformations, code generators, …
Query performance (= the speed of content retrieval) is crucialo First vs. consecutive vs. throughputo Query result vs. query contents
Core problems1. Slow query engines 2. Considerable programming effort necessary to get complex
queries right
EMF-INCQUERY
Overview EMF-INCQUERY: a model query engine
o Supports batch querieso Optimized for incremental queries!
Incremental evaluationo Based on the RETE algorithmo Compute once, update afterwardso Gain: Instant re-evaluationo Price: Uses some more memory• Manageable with proper life cycles
Query engine
RETE networkInput nodes
Intermediate nodes
Outputnodes
Deltamonitor
EMF instance model
Generated query components
Input = Model contents + changes (EMF notifications)
Output = Query results + (subsequent) Query result deltas
Query definition
Benefits of EMF-INCQUERY Makes on-the-fly well-formedness validation, view
maintenance, … feasible over really large instance models
Simplifies writing really complex querieso Graph pattern languageo Highly reusable query libraries
Easy-to-integrate into existing appsoWorks with any EMF domain metamodelo Integrates through Eclipse standards works with
many EMF-based apps out-of-the-box
DEMO School metamodel in EMF
INCQUERY Pattern Language
INCQUERY Pattern Language
Expressive declarative query language by graph patterns
Capture local + global queriesCompositionality + Reusabilility „Arbitrary” Recursion, Negation
New features with version 0.6 Tools
o Xtext2-based language• Content assist (code completion), validation, outline, …
o Unique query language features• Unlimited recursion and transitive closure• Aggregate functions• Match/exceed the expressive power of OCL, while providing more
flexible re-use
Runtimeo Build and execute queries on-the-flyo Strong generative bindings to Javao Efficient incremental transitive closure
INCQUERY Development Tools
Query Explorer
Pattern Editor
Queries are applied & updates on-the-fly
• Works with most EMF-based editors out-of-the-box
• Reveals matches as selection
INCQUERY Model Validation
Markers in the Problems View
Standard Eclipse BPMN Editor
• Works with most EMF-based tools out-of-the-box
• Manages error-warning markers on-the-fly as the user is editing the model = Instantaneous feedback
TRANSPARENT QUERY INTEGRATION
… beyond the development tools
<<derived>>
<<derived>>
<<derived>>
Derived features in EMFDerived features:• Supported by auxiliary
mechanisms (e.g. Java, OCL)• Supported by EMF-based
tools out-of-the-box
Derived edges:• Binary relationships• Supported by binary
INCQUERY patterns
Derived attributes:• Typed scalar values• Supported by
INCQUERY derivatives
INCQUERY derivatives
Derived attribute “hasPrimeWeight”:
True iff pattern “coursePrimeWeight”
matches to host C
You can combine IQPL with (side-effect free, deterministic) Xbase
Key benefits:• Automatic
dependency-aware change notifications for derived features
• Instantaneous result retrieval
PERFORMANCE BENCHMARK
Instantaneous result retrieval?
Benchmarking scenario In-memory models
o Embedded railways control software system design domaino Instance models up to 2.7M elements
Scenario: well-formedness validationo 5 rules, from simple to very complexo Batch validation: loading models + executing querieso On-the-fly revalidation: modifying models + re-executing
queries instantaneously Tools
o Eclipse tools (OCL, INCQUERY, EMF-Java)o RDF/SPARQL engines (for comparison)
http://viatra.inf.mit.bme.hu/publications/trainbenchmark
Revalidation on-the-fly
• Incremental EMF engines typically 5-10x faster
• sub-100ms response times for up to 1.5M elements
SPARQL tools are generally 1-2 Orders-of-Magnitude (OM) slower
than top EMF tools
A closer look at the top
Performance advantage of OCL-IA over OCL is not significant with
complex queries
INCQUERY is 1-1.5 orders-of-magnitude
faster than OCL-IA
Memory usage
• Incremental engines impose a linear memory consumption overhead
• INCQUERY overhead is larger than OCL-IA
• Even the largest models fit into 1GB of RAM
Final points EMF-INCQUERY has been proposed as an
Eclipse.org project under EMFT http://www.eclipse.org/proposals/modeling.emf.incquery/
EMF-INCQUERY 0.6 preview release is available immediatelyo Pointers:
http://viatra.inf.mit.bme.hu/incquery http://viatra.inf.mit.bme.hu/incquery/getting_started http://viatra.inf.mit.bme.hu/performance
Release 0.6 is scheduled shortly after the Eclipse Juno Launch (beginning of July)
Acknowledgements Additional development team members
oMárk Czotter, Tamás Szabó Performance benchmarking
o Benedek Izsó, Zoltán Szatmári Testing, examples
o Attila Csicsely, Tamás Csurgó, Dániel Kávássy, Gábor Szárnyas, Tamás Tóth
Thank you very much!