The exact point at which one is better than the other would depend on
the number of partial matches in memory. To check 91 slots for
modification, Jess has to call 91 getter functions and do 91 value
comparisons. If there are very few partial matches, you can easily
imagine that the amount of computation needed to check all those slots
would be less than that if you called updateObject twice with specific
slot names. On the other hand, in the limit as working memory gets
larger, those 91 comparisons could pale in comparison to what will be
needed to reevaluate all the matches.
An update function that let you specify a list of property names could
improve efficiency on the small-working-memory end of the scale; this
is precisely the regime in which there isn't that much work going on
anyway, so I don't think it's something to worry about. I will make a
note though and we can see about adding it to a future release.
On May 15, 2008, at 10:43 AM, Florian Fischer wrote:
Hello,
I was wondering what is the performance trade-off between
rete.updateObject(myObject);
and
rete.updateObject(myObject, slot);
When I update an object underlying a shadow fact, I record the list of
updated fields and call updateObject only at the end. If only one
field
was updated I pass the slot name as parameter. If I updated more than
one, I make a global update.
But for instance, when updating 2 fields out of 91, would it make
sense
to do two specific updateObject, one for each slot, instead of one
global update? If I do a global updateObject, it will have to reread
all 91 fields. If I do two specific updateObject, it might reorganize
the Rete network twice. So which is better?
Would it make sense to implement a updateObject(String[] slots) for
the
case where you know which fields were updated?
Thanks in advance,
Florian Fischer
--
Florian Fischer
Service d'Informatique Médicale
Hôpitaux Universitaires de Genève
Tél: 022 37 28861
[EMAIL PROTECTED]
--------------------------------------------------------------------
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]
.
--------------------------------------------------------------------
---------------------------------------------------------
Ernest Friedman-Hill
Informatics & Decision Sciences Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
PO Box 969, MS 9012 [EMAIL PROTECTED]
Livermore, CA 94550 http://www.jessrules.com
--------------------------------------------------------------------
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]
--------------------------------------------------------------------