#ORF09 CLIPS implementation of RETE Presentation

This entry is part 27 of 30 in the series October Rules Fest 2009

Gary Riley is talking about his implementation of RETE in CLIPS.

A couple of years ago, benchmarks for rules engines (Manners and Waltz) showed that CLIPS was not not doing well. He wanted to improve speed although it may have not been the only issue.

He started adding different improvements, although he was thinking that none of it was “new” since it had been done elsewhere before. These changes improved performance a great deal.

CLIPS and Java can’t be easily compared since they have 2 different structures. So comparing a C implementation to a Java Object Oriented implementation is not necessarily “fair” since in C you are working closer to the machine and don’t have the overhead.

The biggest improvement was to hash the Alpha memories. The hash table is statically sized which assumes that the user can adapt the size to the needs of the application.

The then hashed the Beta memories as well. In this case, the Beta memories are dynamically resized. It is much harder for a user to try and figure out how to size these memories. It is possible to turn hashing off. In some benchmarks hashing made no difference, but there are use cases that show that beta memory hashing does provide performance improvements.

The Salience (priority) had some advantages in some cases but is costly when implemented as a linked list and inserting somewhere in the middle. So he created Salience Groups which are basically buckets that hold instances with the same salience.

He then talked about how the “Not” conditional element was implemented.

Asymmetric retracts relates to the traditional approach which takes a more symmetric approach to assertions and retractions. So asymmetric retracts work slightly differently, he referred to Tree based removal and a bottom-up approach for removing partial matches.

He also changed the “Exists” conditional element. It is implemented as a single join. it takes just one partial and you don’t need to keep a count.

He then talk about other miscellaneous improvements to the code.

Benchmarks (specifically Manners and Waltz) are useful but they should not be the only thing that people look at.

His conclusions, still good to code in C. Open Source is Good. We need more benchmarks, not different benchmarks to test other parts of the system.

Series Navigation<< #ORF09 October Rules Fest Think Tank – Part II#ORF09 Complex Event Processing Models Presentation >>

Leave a Reply

Your email address will not be published. Required fields are marked *

*


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>