-
Notifications
You must be signed in to change notification settings - Fork 42
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
Performance for loading facts (engine << [fact]) #72
Comments
The biggest issue I'm aware of is that alpha memory cells are not selective enough, and matchers have to repeatedly iterate through long lists of things they're not even interested in. I started rewriting the alpha memory to maintain smaller, more selective indexes some time ago but ran out of steam before I could finish :( |
@ulfurinn did you happen to push the code for that? Otherwise, I'm curious if you've thought of any other ways to optimize this structure? |
No, I never did, but it was just a raw experiment even at its latest. |
The general idea was that permanently assigning an alpha node to a beta node causes issues when the beta node's template has only variables or blanks, so it gets assigned a very generic alpha node because you can't constrain it at compile time without having constants in the matcher rule, so most of that alpha's content will eventually be discarded; so instead alpha memory could index the data on lots of different combinations (like "all facts matching {a _ _}" and "all facts matching {a b _}" etc) and thus amortise a large chunk of the filtering work, and then a beta node could just say "give me your most specific set of data that matches this template". |
That may be an option for us - do you have a specific spot in mind where is would be best to apply a fact-matching set? |
I was experimenting with the load times for large fact bases, and was wondering if there is a way to optimize appending facts to the engine. Is a way to load multiple facts at once and run a final
assert
andprocess_cascade
call?The text was updated successfully, but these errors were encountered: