Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom fact-type-fn causes degradation of performance in rulesets with many facts #239

Closed
WilliamParker opened this issue Nov 27, 2016 · 1 comment

Comments

@WilliamParker
Copy link
Collaborator

WilliamParker commented Nov 27, 2016

When we have a custom fact-type-fn [1] we have to make an isa? call that uses Clojure's custom hierarchies for every fact that is inserted [2]. This turns out to have some pretty significant impacts on performance. Distinguishing between system fact types and user-provided fact types is necessary for functional correctness since a user-provided function might otherwise disrupt the functioning of internally created rules. Currently our only use case for internally created rules is the fix for #149. We may also use them to solve #218. However, we'll need to find something more performant. Using the JVMs type system directly rather than Clojure's hierarchies is a likely candidate.

  1. https://github.com/cerner/clara-rules/blob/0.13.0-RC4/src/main/clojure/clara/rules.cljc#L294
  2. https://github.com/cerner/clara-rules/blob/0.13.0-RC4/src/main/clojure/clara/rules/compiler.clj#L1543
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant