> so I'm thinking that we should replace parts of this with arrays, using
> integer indexes, instead of hashes with string indexes.
>
> Array lookups are quite a bit faster than hash lookups.

I have no idea how painful linked lists are in Perl (or if they even exist).
But if you are essentially iterating over all rules, they could have some
distinct advantages for possible future optimizations.

For instance: just link user rules onto the end of the last system rule.

For instance: reorder rules with a trivial LRU or counted LRU algorithm to
put the most-hit rules first, by dynamic experience.  Then stop processing
rules if score total > x.  (Insert obvious arguments about negative-scoring
rules here.)

LRUs are really cheap in most languages, and if you can do them in Perl this
could be a huge advantage when coupled with an early bailout algorithm.

        Loren

Reply via email to