Hi,
3. About this suggestion again.
I'm testing with my real life example which have a handler with multiple calculation and field updates with setValue().
Without whenRules it's working just fine and takes around 15-20ms to run - this is without FormIf functions that was replaces with whenRules.
With whenRules enabled it takes more than 500ms. It's after fix with (String)null so no recursive processRules calls but still it's called 54 times and takes a lot of time. On testing machines it takes a lot more.
I've created a simple proof of concept.
And in processRules2 method is original code of processRules.
Now same scenario runs in about 20-25ms and original processRules are called only 2 times.
I now this code is plain simple but it's just a proof of concept and maybe there are some caveat's that I'm not aware of but considering huge performance boost I think it's worth looking at.
Best regards
Mariusz Goch
3. About this suggestion again.
I'm testing with my real life example which have a handler with multiple calculation and field updates with setValue().
Without whenRules it's working just fine and takes around 15-20ms to run - this is without FormIf functions that was replaces with whenRules.
With whenRules enabled it takes more than 500ms. It's after fix with (String)null so no recursive processRules calls but still it's called 54 times and takes a lot of time. On testing machines it takes a lot more.
I've created a simple proof of concept.
Code:
isc.RulesEngine.addProperties({ processRules : function (rules, component) { console.log("processRules", component.ID, rules); if (!this.processRulesTimeout) { this.processRulesTimeout = {}; } if (this.processRulesTimeout[component.ID]) { clearInterval(this.processRulesTimeout[component.ID]); } this.processRulesTimeout[component.ID] = setTimeout(() => { this.processRules2(rules, component); }, 0); } });
Now same scenario runs in about 20-25ms and original processRules are called only 2 times.
I now this code is plain simple but it's just a proof of concept and maybe there are some caveat's that I'm not aware of but considering huge performance boost I think it's worth looking at.
Best regards
Mariusz Goch
Comment