[rules-users] Drools 5.2 performance building KnowledgeBase

Mark Proctor mproctor at codehaus.org
Tue Aug 9 13:57:03 EDT 2011


We believe this has been introduced to MVEL hitting the classloader too 
much. Mario is looking into fixing this.

Mark
On 09/08/2011 18:38, darktyco wrote:
> Has anyone out there experienced any slowdowns using Drools 5.2 to build a
> knowledge base? I have around 700 drl files (containing anywhere from 1 to
> 30 rules each) and the time to build a KnowledgeBase with them has increased
> from about 10 minutes in Drools 5.1 to 90 minutes in Drools 5.2. I realize I
> have a slow computer here, but the time difference between the two versions
> is staggering.
>
> I have already been serializing the KnowledgeBase object for performance
> reasons and even loading the serialized KnowledgeBase takes about 3-4x
> longer in 5.2 than in 5.1. Am I doing something wrong here? Here are some
> code snippets of how I am building and loading the kbase:
>
> //////////////////////// Building
> final KnowledgeBuilder kBuilder =
> KnowledgeBuilderFactory.newKnowledgeBuilder();
> final List<File>  drlFiles = getAllDrlFiles(directory);
> for (final File name : drlFiles) {
>          kBuilder.add(ResourceFactory.newFileResource(name),
> ResourceType.DRL);
> }
> if (kBuilder.hasErrors()) {
>          // ....
> }
> final KnowledgeBase kBase = KnowledgeBaseFactory.newKnowledgeBase();
> kBase.addKnowledgePackages(kBuilder.getKnowledgePackages());
> ObjectOutputStream oos = null;
> try {
>          oos = new DroolsObjectOutputStream(new FileOutputStream(pkgFile));
>          oos.writeObject(kBase);
> } catch (...) {
>          // ....
> }
>
> //////////////////////// Loading
> ois = new DroolsObjectInputStream(new FileInputStream(pkgFile));
> final KnowledgeBase kBase = (KnowledgeBase) ois.readObject();
> final StatefulKnowledgeSession ksession =
> kBase.newStatefulKnowledgeSession();
>
> Thanks!
>
> --
> View this message in context: http://drools.46999.n3.nabble.com/Drools-5-2-performance-building-KnowledgeBase-tp3239746p3239746.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>





More information about the rules-users mailing list