Budapest University of Technology and Economics      Efficient Model Transformations  by Combining Pattern Matching Strate...
Budapest University of Technology and EconomicsTalk Overview                                                        GT & P...
Budapest University of Technology and EconomicsIntroduction Common problem to be solved by model  transformation tools:  ...
Budapest University of Technology and EconomicsBenchmarking Aim:  − systematic and reproducible measurements  − on perfor...
Budapest University of Technology and EconomicsTalk overview                                                        GT & P...
Budapest University of Technology and EconomicsMetamodeling                               Package                         ...
Budapest University of Technology and EconomicsGraph Transformation                 schemaRule                            ...
Budapest University of Technology and EconomicsPattern matching techniques  Execution strategies  − Interpreted: AGG (Tig...
Budapest University of Technology and EconomicsTraditional Local Search-based patternmatching Method  − usually defined a...
Budapest University of Technology and EconomicsLocal Search based Pattern Matching Example                                ...
Budapest University of Technology and EconomicsIncremental Pattern Matching Goal  − Store matching sets  − Incremental up...
Budapest University of Technology and EconomicsIncremental Pattern Matching Example•  RETE net    –  nodes: intermediate m...
Budapest University of Technology and EconomicsTalk overview                                                        GT & P...
Budapest University of Technology and EconomicsHybrid pattern matching Idea: combine local search-based and  incremental ...
Budapest University of Technology and EconomicsWhere LS might be better… Memory consumption  − RETE sizes grow roughly li...
Budapest University of Technology and EconomicsCase study: ORM Synchronization                                    :schemaR...
Budapest University of Technology and EconomicsPhases  Check Phase                                            Initial Tr...
Budapest University of Technology and EconomicsPhases  Check Phase                                            Initial Tr...
Budapest University of Technology and EconomicsHybrid PM in the source code                                              A...
Budapest University of Technology and EconomicsTalk overview                                                        GT & P...
Budapest University of Technology and EconomicsEnvironment Hardware and OS  − 1.8 GHz Intel Core2 Duo  − 2048 MB RAM  − W...
Budapest University of Technology and EconomicsComposite ORM Synchronization benchmark                                    ...
Budapest University of Technology and EconomicsConsiderations for selecting PM strategy  Graph pattern static attributes ...
Budapest University of Technology and EconomicsAdaptive hybrid pattern matching  Goal: provide (semi-) automatic aid for ...
Budapest University of Technology and EconomicsFurther benchmarking Paper for a GRaBaTS 2008 special issue in  STTT’09: E...
Budapest University of Technology and EconomicsAntWorld Results          Linear characteristic           retained, slower ...
Budapest University of Technology and EconomicsMemory footprint              Linear reduction in               memory over...
Budapest University of Technology and EconomicsSummaryOptimization strategy               Performance                  Mem...
Budapest University of Technology and Economics                                        ?Fault-tolerant Systems Research Gr...
Upcoming SlideShare
Loading in …5
×

Efficient model transformations by combining pattern matching strategies

405 views

Published on

Conference presentation at ICMT 2009.

Published in: Technology, Economy & Finance
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
405
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
5
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Efficient model transformations by combining pattern matching strategies

  1. 1. Budapest University of Technology and Economics Efficient Model Transformations by Combining Pattern Matching Strategies Gábor Bergmann, Ákos Horváth, István Ráth, Dániel VarróFault-tolerant Systems Research Group
  2. 2. Budapest University of Technology and EconomicsTalk Overview GT & PM Introduction overview Hybrid PM Measurements Fault-tolerant Systems Research Group
  3. 3. Budapest University of Technology and EconomicsIntroduction Common problem to be solved by model transformation tools: − Efficient query and manipulation of complex graph- based patterns One possible solution: − Graph transformation Fault-tolerant Systems Research Group
  4. 4. Budapest University of Technology and EconomicsBenchmarking Aim: − systematic and reproducible measurements − on performance − under varying and precisely defined circumstances Overall goal: − help transformation engineers in selecting tools − serve as reference for future research Popular approach in different fields − AI − relational databases − rule-based expert systems Fault-tolerant Systems Research Group
  5. 5. Budapest University of Technology and EconomicsTalk overview GT & PM Introduction overview Hybtid PM Measurements Fault-tolerant Systems Research Group
  6. 6. Budapest University of Technology and EconomicsMetamodeling Package schemaRef Schema Class tableRef Table Association tableRef fKeyRef EndPoint ForeignKey columnRef Metamodel Attribute Column Instance model jarEntry: Class lang: Package jarFile: Class jar: Package java: Package Fault-tolerant Systems Research Group
  7. 7. Budapest University of Technology and EconomicsGraph Transformation schemaRule :schemaRef Con: Container java: Package Schema <<contains>> NEG {NEW} P: Package SN:Schema lang: Package :schemaRef {NEW} jar: Package Phases of GT matching – Pattern Matching phase – Updating phase: delete+ create Pattern Matching is the most critical issue from the performance viewpoint (in our experience) Fault-tolerant Systems Research Group
  8. 8. Budapest University of Technology and EconomicsPattern matching techniques  Execution strategies − Interpreted: AGG (Tiger), VIATRA, MOLA, Groove, ATL ● underlying PM engine − Compiled: Fujaba, GReAT, PROGRES, Tiger, VMTS, GrGEN.NET, ... ● directly executed as C(#) or Java code  Algorithms − Constraint satisfaction: AGG (Tiger) ● variables + constraints − Local search (LS): Fujaba, GReAT, PROGRES, VIATRA, MOLA, Groove, Tiger (Compiled), GrGEN.NET, ... ● step-by-step extension of the matching − Incremental (INC): VIATRA, Tefkat ● Updated cache mechanism Fault-tolerant Systems Research Group
  9. 9. Budapest University of Technology and EconomicsTraditional Local Search-based patternmatching Method − usually defined at design/compile time − simple search plan − hard wired precedence for constraint checking (NAC, injectivity, attribute, etc.) ● Can be done adaptively Good performance expected when: − Small patterns, bound input parameters Fault-tolerant Systems Research Group
  10. 10. Budapest University of Technology and EconomicsLocal Search based Pattern Matching Example frequently used & efficient solution schemaRule Con: Container Search plan <<contains>> NEG Con P: Package SN:Schema 1 :schemaRef <<contains>> 2 P 3 Constraint checking (NAC, Search sequence injectivity, etc.) order of traversal in the search plan Fault-tolerant Systems Research Group
  11. 11. Budapest University of Technology and EconomicsIncremental Pattern Matching Goal − Store matching sets − Incremental update − Fast response Good performance expected when: − frequent pattern matching − Small updates Possible application domain − E.g. synchronization, constraints, model simulation, etc. In VIATRA: an adapted RETE algorithm Fault-tolerant Systems Research Group
  12. 12. Budapest University of Technology and EconomicsIncremental Pattern Matching Example•  RETE net –  nodes: intermediate matchings INPUT p4 –  edge: update propagation p1 p2 p3 c1 c2 s1 p4•  Example p4 p4 p4 –  input: schemaRule pattern Package Class Schema –  pattern: contained Package p1 p2 p3 p4 c1 c2 s1 –  update: new package p4 p1: Package <<contains>> p1, p2 p1, p3 p3, p4 p2: Package p3: Package p4 p3, p4 NACschemaRef p2, s1 s1:Schema c1: Class p4: Package out p1, p3 p3,p4 Fault-tolerant Systems Research Group
  13. 13. Budapest University of Technology and EconomicsTalk overview GT & PM Introduction overview Hybrid PM Measurements Fault-tolerant Systems Research Group
  14. 14. Budapest University of Technology and EconomicsHybrid pattern matching Idea: combine local search-based and incremental pattern matching Motivation − Incremental PM is better for most cases, but… ● Has memory overhead! ● Has update overhead −  LS might be better in certain cases Based on experience with a ”real world” transformation application1 1Kovacs, M., Lollini, P., Majzik, I., Bondavalli, A.: An Integrated Framework for the Dependability Evaluation of Distributed Mobile Applications (SERENE’08) Fault-tolerant Systems Research Group
  15. 15. Budapest University of Technology and EconomicsWhere LS might be better… Memory consumption − RETE sizes grow roughly linearly with the model space − Constrained memory  trashing Cache construction time penalty − RETE networks take time to construct − „navigation patterns” can be matched quicker by LS Expensive updates − Certain patterns’ matching set is HUGE − Depends largely on the transformation Fault-tolerant Systems Research Group
  16. 16. Budapest University of Technology and EconomicsCase study: ORM Synchronization :schemaRef : Package : Schema :tableRef : Class : Table :columnRef : Attribute : Attribute : Column : Column :columnRefTransformation workflow Check Modify Perform source source Synchronize mapping model model Fault-tolerant Systems Research Group
  17. 17. Budapest University of Technology and EconomicsPhases  Check Phase   Initial Transformation − Well-formedness checking − Match reusability − Static graph structure − Unidirectional − No model manipulation − Complex rules − Batch like execution  Refactoring   Synchronization − Single rule executed: − Match reusability move package in the − Unidirectional hierarchy − Simple rules − Manual execution − Live execution Fault-tolerant Systems Research Group
  18. 18. Budapest University of Technology and EconomicsPhases  Check Phase   Initial Transformation − Simple patterns, looking − Processes the entire only for the first match model (full traversal) − INC: cache construction − Match set may not fit into penalty high memory − LS may be a better choice − Solution: decompose, use LS for certain patterns  Refactoring   Synchronization − Move in containment − INC significantly better (as hierarchy: very expensive demonstrated at ICGT08) cache update − LS can be significantly better Fault-tolerant Systems Research Group
  19. 19. Budapest University of Technology and EconomicsHybrid PM in the source code Assign a PM implementation on a per-pattern (per-rule) basis  ability to fine tune performance on a very fine grained level. Fault-tolerant Systems Research Group
  20. 20. Budapest University of Technology and EconomicsTalk overview GT & PM Introduction overview Hybrid PM Measurements Fault-tolerant Systems Research Group
  21. 21. Budapest University of Technology and EconomicsEnvironment Hardware and OS − 1.8 GHz Intel Core2 Duo − 2048 MB RAM − Windows XP SP3 − Sun JVM 1.6.0_02 for VIATRA Tool related − VIATRA2 R3 Build 2009.02.03 − Standard services of the default distribution Fault-tolerant Systems Research Group
  22. 22. Budapest University of Technology and EconomicsComposite ORM Synchronization benchmark Hybrid
scales
 be-er
with
 increasingly
large
 models!
 Fault-tolerant Systems Research Group
  23. 23. Budapest University of Technology and EconomicsConsiderations for selecting PM strategy  Graph pattern static attributes − Number of patterns − Pattern size − Containment constraints  Control structures − Parameter passing − Usage frequencies − Model update cost  Model-dependent pattern characteristics − Model statistics (instance count) Fault-tolerant Systems Research Group
  24. 24. Budapest University of Technology and EconomicsAdaptive hybrid pattern matching  Goal: provide (semi-) automatic aid for strategy selection  Idea: monitor memory usage − JVM telemetry  Prevent heap exhaustion − Destroy match set cache structures − Switch to LS PM Strategy Used heap [MB] Transform phase execution time [s] LS 201 77.1 INC 353 13.6 Static hybrid 220 10.9 Adaptive hybrid 235 35.7 Fault-tolerant Systems Research Group
  25. 25. Budapest University of Technology and EconomicsFurther benchmarking Paper for a GRaBaTS 2008 special issue in STTT’09: Experimental assessment of combining pattern matching strategies with VIATRA2 In-detail investigation − hybrid approach − Transformation language-level optimizations Optimization − Based on experience with ICMT’09 paper Fault-tolerant Systems Research Group
  26. 26. Budapest University of Technology and EconomicsAntWorld Results Linear characteristic retained, slower by only a constant multiplier Fault-tolerant Systems Research Group
  27. 27. Budapest University of Technology and EconomicsMemory footprint Linear reduction in memory overhead Fault-tolerant Systems Research Group
  28. 28. Budapest University of Technology and EconomicsSummaryOptimization strategy Performance Memory footprintLS High order polynomial ConstantSwitch to INC Polynomial order reduction Linear increase with model sizeSwitch to Hybrid Linear (~50%) reduction Linear (~50%) reduction In short: you may get a linear decrease in memory for a linear increase in execution time  retains complexity class characteristics  Fault-tolerant Systems Research Group
  29. 29. Budapest University of Technology and Economics ?Fault-tolerant Systems Research Group

×