Hi Osvaldo,

Interesting. This fact-uniqueness check code has never shown up as a
time-eater in any profiles I've done - I wonder why? Java profiling
technology is not so hot in general, it seems. In any case, I
see small but noticeable improvements in some of my benchmarks if it
is removed, of the order of 3-8%. Only somewhat pathological systems
could get the enormous improvement you have seen, since generally
assert time is dominated by processing in the join network, not by the
simple mechanics of fact-list manipulation (since the latter scales
linearly, while the former scales quadratically or worse.) It might be
that the speedup was not due to uniqueness processing, but to event
processing. Event overhead in 5.0a4 is quite high - the situation is
vastly improved in my working version.

CLIPS has a (set-fact-duplication) command to toggle this behaviour,
and I can't think of any reason why Jess couldn't support this as
well. I have added such a command, as well as set/getFactDuplication()
methods in the Rete class. They will be in the next alpha (maybe even
by the end of this week, but next week at the latest.) Thus you'll be
able to get the speed improvements without hacking Jess's internals
(never a good idea during an alpha period, since so many things can
change so much.)


I think Osvaldo Pinali Doederlein wrote:
> 
> From: Osvaldo Pinali Doederlein <[EMAIL PROTECTED]>
> 
> >   public int assertQuick (ValueVector f) throws ReteException
> >   {
> >     synchronized (m_compiler)
> >       {
> >         // insert the new fact
> >         f.set(new Value(nextFactId(), RU.FACT_ID), RU.ID);
> >         m_facts.addElement(f);
> >
> >         return f.get(RU.ID).factIDValue();
> >       }
> >   }
> 
> Oops!  Just realized that I cut too much :) this fixed version works, it's
> much slow but at 1,1 second for 10Kfacts I guess I can live with that :)
> 
>   public int assertQuick (ValueVector f) throws ReteException
>   {
>     synchronized (m_compiler)
>       {
>         // insert the new fact
>         f.set(new Value(nextFactId(), RU.FACT_ID), RU.ID);
>         m_facts.addElement(f);
> 
>         Token t = new Token(RU.ADD, f);
> 
>         // Send it to the Rete network
>         processToken(t);
> 
>         return f.get(RU.ID).factIDValue();
>       }
>   }
> 
> ---------------------------------------------------------------------
> To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
> in the BODY of a message to [EMAIL PROTECTED], NOT to the
> list. List problems? Notify [EMAIL PROTECTED]
> ---------------------------------------------------------------------
> 
> 


---------------------------------------------------------
Ernest Friedman-Hill  
Distributed Systems Research        Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
Org. 8920, MS 9214                  [EMAIL PROTECTED]
PO Box 969                  http://herzberg.ca.sandia.gov
Livermore, CA 94550

---------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the
list. List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------

Reply via email to