What does your rules look like? when you load object A, it does
pattern matching, but probably it may not be doing joins. I'm guess
your rule join A and B. If that is the case, the rule engine is doing
what it is suppose to do, pattern match A against B.

you may want to rewrite your rule to make loading more efficient.

peter

On 5/11/05, Negoita, Cristian <[EMAIL PROTECTED]> wrote:
>  
> 
> Hi all, 
> 
> I am using Rete engine to load up large amount of facts in the working area.
> (let's say 50.000 facts of type A and 500.000 facts of type B) 
> 
> The problem is that: if I load FIRST facts A, these are loaded fast, but
> AFTER that, facts B are loaded very slowly. 
> 
> And the other way around, if I start with B, the 500.000 objects are loaded
> fast and after the remaining 50.000 of A very slow. 
> 
> I have tried more than one way to load up: 1) new Fact / rete.assertFact() 
> 
> 
> 
> 
>  
> 
>   2) new ObjectA  / rete.definstance(ObjectA", objectA, false) 
> 
>   3) new ObjectA  / rete.store(ObjectA", objectA) /
> rete.executeCommand("(definstance ObjectA (fetch    ObjectA) static)"); 
> 
> Below is a code snippet with variant 1) (but as said, I've tried all three).
> Objects/facts I use are not complex, they have only a few fields. 
> 
> Maybe someone has met the problem already, and I do smth wrong, or maybe I
> reach the limits of Rete engine? 
> 
> ... 
> 
> // instead of ObjectA it is written Request 
> 
>  private static void loadRequests() throws JessException { 
> 
>         long beginTime = System.currentTimeMillis(); 
> 
>         Fact f = null; 
> 
>         System.out.println("Start loading requests ..."); 
> 
>         for (int requestId = 1; requestId <=50000; requestId++ ) { 
> 
>             f = new Fact("Request", rete); 
> 
>             f.setSlotValue("addressType", new Value(0, RU.INTEGER)); 
> 
>             f.setSlotValue("requestType", new Value(0, RU.INTEGER)); 
> 
>             f.setSlotValue("requestID", new Value(requestId, RU.INTEGER)); 
> 
>             rete.assertFact(f); 
> 
>         } 
> 
> } 
> 
> ... 
> 
> // instead of ObjectsB it is written Hits 
> 
> private static void loadHits() throws JessException { 
> 
>         Fact f = null; 
> 
>         long beginTime = System.currentTimeMillis(); 
> 
>         System.out.println("Start loading hits ..."); 
> 
>         for (int requestId=1; requestId <= 50000; requestId++) { 
> 
>             for (int i = 1; i<=10; i++) { 
> 
>                 f = new Fact("CustomerHit", rete); 
> 
>                 f.setSlotValue("hitID", new Value(i+requestId, RU.INTEGER));
> 
>                 f.setSlotValue("customerID", new Value(0, RU.INTEGER)); 
> 
>                 f.setSlotValue("requestID", new Value(requestId,
> RU.INTEGER)); 
> 
>                 f.setSlotValue("companyID", new Value(i, RU.INTEGER)); 
> 
>                 rete.assertFact(f); 
> 
>             } 
> 
>         } 
> 
>         System.out.println("Time for loading " + (REQUEST_NO * 10) + " hits
> : " + (System.currentTimeMillis() - beginTime)); 
> 
> } 
> 
> ... 
> 
> Thanks in advance for your answer, 
> 
> Cristian Negoita 
> 
>   
> 
>

--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to