I got more information after debugging this. It seems like the time that
takes to load a KnowledgePackage increases as the number of KnowledgePackage
that I already have in my KnowledgeBase increases. So, my KB right now has
28 KPs, and that is when loading a new KP takes a long time. However, if I
Is there maybe a way to add those KnowledgePackages at startup time
but somehow make them "hidden" and then just activate them when the KP
needs to be available for execution and hiding it again (not available
for execution) when they need to be unloaded?
Thanks.
Sent from my iPhone
On Ma
I see. Thanks Rajnikant. I appreciate the assistance. I hope there would be
a way to maybe make this more internal to the KnowledgeBase object itself,
or define another object for this type of caching instead of creating this
complexity outside. Does anyone have another approach? Or is it basically
As I said earlier It *may* or *may not* be relevant in your case. Usually
caching improves performance significantly in drools.
In case of our application it does so by a very significant factor.
Regards,
Rajnikant Gupta
http://rkthinks.wordpress.com/
2010/5/3 Moe Alkhafaji
> Hmmm, so you
Hmmm, so you are suggesting I keep caches all possible combinations of
KnowledgePackages? If I have 100 possible KnowledgePackages and they
are loaded and unloaded dynamically that means I will have to have 100
choose n where n goes from 1 to 100. That will make me go out of
memory easy no?
It may look something like this:
Map *knowledgeBaseCacheMap* = new HashMap();
this.knowledgeBase = knowledgeBaseCacheMap.get("");
if(this.knowledgeBase == null){
this.knowledgeBase.addKnowledgePackages(packages);
*knowledgeBaseCacheMap.put("", this.knowledgeBase)*
}
By doing this the pack
Thanks for the reply. But I don't understand what you mean by caching
the KnowledgeBase. This is about adding a pre compiled
KnowledgePackage to a KnowledgeBase. So, how does caching a
KnowledgeBase makes addition of new KnowledgePackage faster? Please
excuse my ignorance if I am not catchi
Hi,
Yes, adding packages to knowledgeBase does take some time. You can probably
try caching your knowledgeBase. By doing this all, but first,
requests should be significantly fast.
Regards,
Rajnikant Gupta
http://rkthinks.wordpress.com/
On Mon, May 3, 2010 at 11:36 AM, malkhafaji wrote:
>
Hello,
I am trying to add knowledge packages to an existing KnowledgeBase. My
largest DRL file has 110 rules. I noticed that it may take up to 5 seconds
just to execute the following statement:
this.knowledgeBase.addKnowledgePackages(packages);
where "packages" is just a list of one knowledge p