|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
JESS: performance trade-of in updateObject(...)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 florian.fischer@... -------------------------------------------------------------------- To unsubscribe, send the words 'unsubscribe jess-users you@...' in the BODY of a message to majordomo@..., NOT to the list (use your own address!) List problems? Notify owner-jess-users@.... -------------------------------------------------------------------- |
|
|
Re: JESS: performance trade-of in updateObject(...)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 > florian.fischer@... > > > > -------------------------------------------------------------------- > To unsubscribe, send the words 'unsubscribe jess-users > you@...' > in the BODY of a message to majordomo@..., NOT to the list > (use your own address!) List problems? Notify owner-jess-users@... > . > -------------------------------------------------------------------- --------------------------------------------------------- Ernest Friedman-Hill Informatics & Decision Sciences Phone: (925) 294-2154 Sandia National Labs FAX: (925) 294-2234 PO Box 969, MS 9012 ejfried@... Livermore, CA 94550 http://www.jessrules.com -------------------------------------------------------------------- To unsubscribe, send the words 'unsubscribe jess-users you@...' in the BODY of a message to majordomo@..., NOT to the list (use your own address!) List problems? Notify owner-jess-users@.... -------------------------------------------------------------------- |
|
|
JESS: Re: performance trade-of in updateObject(...)Hello,
I never got a reply on that one. In the meantime, after doing the change I described, I realized that my rules don't all fire. A simple rule like (defrule MAIN::dpa-unit-reload-on-add (care-unit (initialLoad TRUE) (needLoadSermeds FALSE) (needReloadPatients TRUE) (OBJECT ?ou)) (service-activity (available TRUE) (service "SAMU")) => (printout t "(jess) Initial load for unit " (call ?ou getId) crlf) (call ?ou reloadPatients)) doesn't fire for all care units. After Jess is done running, I wonder why some care units have not been loaded. I re-enter the same rule (copied from a ppdefrule of the rule itself in Jess) and the rule starts firing. One time I even had to enter the rule twice in a row before having all care units processed. And it is not just reloadPatient that failed to change the flags. The text "(jess) Initial load for unit XXX" does not appear on the standard output. Removing (slot-specific TRUE) from all my templates fixed that. Removing it from only care-unit did not. Note that I no more use propertyChangeEvents to inform Jess of changes. I now use updateObject on one or all slots as I described below. I could have made a mistake somewhere but when I request the facts from Jess, they look correct to me, so it is not an update problem. I now deal with Jess problems this way. A rule that acts funny is removed from Jess and some code is written to supplement it outside of Jess. Regards, Florian 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 florian.fischer@... -------------------------------------------------------------------- To unsubscribe, send the words 'unsubscribe jess-users you@...' in the BODY of a message to majordomo@..., NOT to the list (use your own address!) List problems? Notify owner-jess-users@.... -------------------------------------------------------------------- |
| Free Forum Powered by Nabble | Forum Help |