Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In FormioData, glom is used to perform a deep set/get on the data, which is required for keys with a '.' as they indicate a nested data structure. Unfortunately, glom is slow, as already previously shown by the patch for GH-4744. For forms with lots of form variables (300+), creating a FormioData instance while using `glom.assign` in __setitem__ is an expensive task. Especially for forms which also contain lots of logic rules (50+), this can hurt the performance of a check-logic call, as multiple FormioData instances are created when evaluating each logic rule. This patch is a bandaid fix where we bypass `glom.assign` when setting an item in FormioData.__setitem__. If the key does not contain a '.', which means it is a top-level key, we set the value on self.data directly. Otherwise, we use `glom.assign` for a deep assignment of the value. It is labeled as a bandaid fix, because the underlying problem of creating lots of FormioData instances is still present. This is not addressed here as it must be possible to backport this patch easily. Investigating and refactoring the complete data structures will take more time. Backport-Of: #5118 (cherry picked from commit 47bf93a)
- Loading branch information