Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[henshin-dev] Support for EMap in Matching Engine

Dear all,

I yesterday committed a patch to the Henshin Interpreter Engine to exploit
EMap references to speed up the matching.

In EMF, you can create special references which use an EMap as data
structure and then use a key to quickly match the value without iterating
over all objects. See the EMF wiki how to use this in your meta model.
(http://wiki.eclipse.org/index.php/EMF-FAQ#How_do_I_create_a_Map_in_EMF.3F)

I also created an example (as part of the examples-plugin) which is shown
in the attachment. It is based on the original Bank example. But this
version uses the EMap-references for a quick matching of Accounts based on
the accountIDs as keys. With the new support for EMap references in the
interpreter, executing the transferMoney-rule 10.000 times on a bank with
100.000 accounts is 3 seconds compared with 300 seconds without the
support.

However, it is important that the ordering of the variables for the
interpreter is in such a way that the EMap-node is matched before the
„value“ nodes (in the banking example the Bank2AccountMap-node before the
Account-node). This is currently not well supported by the automatic
variable optimization, so you might switch it off and order the nodes
manually in the tree editor in a good way which i also had to do for the
new banking example.

Cheers,

Matthias

Attachment: bankmap_henshin.pdf
Description: bankmap_henshin.pdf

Attachment: bankmap.pdf
Description: bankmap.pdf


Back to the top