Menu

1 / 2

Scoped Re-evaluation: Preventing Unnecessary FEEL Expression Evaluation in Large Forms

DEV Community·Sam Abaasi·6 months ago
#t8fU7ST5
#optimization#camunda#bpmnio#field#const
Reading 0:00
15s threshold

Part 22 of the series: "Extending bpmn-io Form-JS Beyond Its Limits"

The evaluator pattern from Article 8 has a performance assumption built into it: when changed fires, re-evaluate everything. For small forms this is fine. For a form with 50 fields that loads pre-populated data, it's a problem.

When Form-JS loads pre-populated data, it writes each field's value into form state. Each write fires a changed event. A 50-field form fires 50 changed events on load. If you have five evaluators, each one re-evaluating all 50 components on every event, that's 50 × 5 × 50 = 12,500 evaluations on load. Most of them evaluate the same expressions against the same data they already evaluated 10ms ago.

This article documents the DateTimeValidationEvaluator as a case study in scoped re-evaluation — an evaluator that fires only when relevant fields change, filters its context to only relevant data, and skips _setState calls when nothing changed.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.