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

Improve performance of ASK and POST knowledge interactions by reusing ReasonerProcessor. #544

Open
bnouwt opened this issue Sep 30, 2024 · 0 comments

Comments

@bnouwt
Copy link
Collaborator

bnouwt commented Sep 30, 2024

Currently, every time a Knowledge Interaction is activated the ReasonerProcessor is recreated and part of this process is the costly graph pattern matching algorithm. Under certain circumstances (i.e. when the network is stable), the ReasonerProcessor can be reused which improves the performance considerably.

Doing a quick and dirty and naive implementation of this in the InteractionProcessorImpl where we reuse the ReasonerProcessor object when encountering the same KnowledgeInteraction object shows that for the TestPostReactPerformance test where the same knowledge interaction is repeated 1000 times it improved the performance per interaction from 9.5ms to 4.5ms. So, almost twice as fast.

So, this is an obvious place to further improve the performance of the knowledge engine when the network is (quite) stable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant