Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "VIATRA/Releases/NewAndNoteworthy1.5"

(Created page with "== Support for more number literals in query language == All number literals supported by Xtend (see [https://eclipse.org/xtend/documentation/203_xtend_expressions.html#numbe...")
 
 
(5 intermediate revisions by 3 users not shown)
Line 9: Line 9:
 
}
 
}
 
</source>
 
</source>
 +
 +
== Performance improvements ==
 +
 +
=== Performance tuning with functional dependencies ===
 +
 +
Version 1.5 introduces greatly improved inference of functional dependencies among pattern variables, which may significantly influence query evaluation performance.
 +
 +
One can now also use the <code>@FunctionalDependency</code> annotation to manually specify additional dependency rules, in order to express domain-specific insight. See below for examples of the syntax:
 +
 +
<source lang="java">
 +
// Here the first annotation is superfluous, as it is inferred automatically anyway
 +
// The second annotation expresses valuable domain knowledge though
 +
@FunctionalDependency(forEach = house, unique = street, unique = houseNumber)
 +
@FunctionalDependency(forEach = street, forEach = houseNumber, unique = house)
 +
pattern address(house: House, street: Street, houseNumber: java Integer) {
 +
Street.houses(street, house);
 +
House.number(house, houseNumber);
 +
}
 +
 +
// Houses are either on a Street or on a Road, but not both at the same time;
 +
//  however Viatra is not smart enough (yet) to figure that out.
 +
// In disjunctive patterns, all dependencies have to be specified manually!
 +
@FunctionalDependency(forEach = house, unique = location)
 +
pattern locatedOnThoroughfare(house: House, location: Thoroughfare) {
 +
Street.houses(location, house);
 +
} or {
 +
Road.houses(location, house);
 +
}
 +
</source>
 +
 +
More details available [[VIATRA/Query/UserDocumentation/AdvancedPatterns#Functional_dependencies|here]].
 +
 +
=== Further optimizations in the incremental query evaluator ===
 +
 +
Constant values (more precisely constant-value filtering) within patterns are now handled more efficiently in many cases. In a proprietary code base, specifically for entire query packages where this feature is heavily used, we have observed a reduction between 15-30% in the memory footprint of Rete.
 +
 +
As an additional minor memory improvement, the results of eval/check expressions are no longer cached in Rete by default. In case some such expressions involve particularly expensive computations, one can restore the original caching behaviour either globally or on a per-pattern basis using the appropriate hint option introduced into the <code>ReteHints</code> class.
 +
 +
== Remote debugging support added to the VIATRA model transformation debugger ==
 +
 +
The VIATRA model transformation debugger (introduced in VIATRA 1.3.0) has undergone a series of architectural  and backend-related changes. The current, 0.15.0 version of the debugger now enables the user to connect to remote VIATRA model transformations, while maintaining the user experience introduced in the previous version. This way, model transformations running on remote JVM instances can be analysed much more straightforward way.
 +
 +
Sounds interesting? Make sure to check out the following resources:
 +
 +
* [http://static.incquerylabs.com/projects/viatra/viatra-docs/ViatraAdvanced.html#_viatra_debugger# VIATRA transformation debugger user's guide]
 +
* [https://www.youtube.com/watch?v=TaLvKgfxQNg# VIATRA transformation debugger 0.15.0 feature demonstration screencast]
 +
 +
== Using project dependencies in Query Maven plugin ==
 +
 +
You can now use ''useProjectDependencies'' in your configuration instead of adding metamodels as Maven dependencies. This is especially useful when the metamodels are not available as Maven artifacts.
 +
 +
<source lang="xml">
 +
<configuration>
 +
  <!-- in addition to existing configuration -->
 +
  <useProjectDependencies>true</useProjectDependencies>
 +
<configuration>
 +
</source>
 +
 +
 +
For more details, see the following [[VIATRA/UserDocumentation/Build#viatra-maven-plugin|wiki page]].

Latest revision as of 10:43, 5 December 2016

Support for more number literals in query language

All number literals supported by Xtend (see documentation for details) are now directly supported by the VIATRA Query language.

pattern circleConstantDiameter1(c : Circle) {
  Circle.diameter(c, 3l);
  Circle.area(c, 9.42f);
}

Performance improvements

Performance tuning with functional dependencies

Version 1.5 introduces greatly improved inference of functional dependencies among pattern variables, which may significantly influence query evaluation performance.

One can now also use the @FunctionalDependency annotation to manually specify additional dependency rules, in order to express domain-specific insight. See below for examples of the syntax:

// Here the first annotation is superfluous, as it is inferred automatically anyway
// The second annotation expresses valuable domain knowledge though
@FunctionalDependency(forEach = house, unique = street, unique = houseNumber)
@FunctionalDependency(forEach = street, forEach = houseNumber, unique = house)
pattern address(house: House, street: Street, houseNumber: java Integer) {
	Street.houses(street, house);
	House.number(house, houseNumber); 
}
 
// Houses are either on a Street or on a Road, but not both at the same time;
//  however Viatra is not smart enough (yet) to figure that out.
// In disjunctive patterns, all dependencies have to be specified manually!
@FunctionalDependency(forEach = house, unique = location)
pattern locatedOnThoroughfare(house: House, location: Thoroughfare) {
	Street.houses(location, house);
} or {
	Road.houses(location, house);
}

More details available here.

Further optimizations in the incremental query evaluator

Constant values (more precisely constant-value filtering) within patterns are now handled more efficiently in many cases. In a proprietary code base, specifically for entire query packages where this feature is heavily used, we have observed a reduction between 15-30% in the memory footprint of Rete.

As an additional minor memory improvement, the results of eval/check expressions are no longer cached in Rete by default. In case some such expressions involve particularly expensive computations, one can restore the original caching behaviour either globally or on a per-pattern basis using the appropriate hint option introduced into the ReteHints class.

Remote debugging support added to the VIATRA model transformation debugger

The VIATRA model transformation debugger (introduced in VIATRA 1.3.0) has undergone a series of architectural and backend-related changes. The current, 0.15.0 version of the debugger now enables the user to connect to remote VIATRA model transformations, while maintaining the user experience introduced in the previous version. This way, model transformations running on remote JVM instances can be analysed much more straightforward way.

Sounds interesting? Make sure to check out the following resources:

Using project dependencies in Query Maven plugin

You can now use useProjectDependencies in your configuration instead of adding metamodels as Maven dependencies. This is especially useful when the metamodels are not available as Maven artifacts.

<configuration>
  <!-- in addition to existing configuration -->
  <useProjectDependencies>true</useProjectDependencies>
<configuration>


For more details, see the following wiki page.

Copyright © Eclipse Foundation, Inc. All Rights Reserved.