Closed helen-m-lin closed 4 months ago
dupe of #159
Profiling shows that for empty Rig, we have keyboard events taking approx. 200ms to process, and for "filled" Rig each keyboard event can take up to 2.5s. The performance issue is due to a few embedded calls to
AJV8Validator.isValid()
and Ajv.addSchema()
- 94% of total time is spent through json-schema-traverse
Relevant issue in RJSF repo: https://github.com/rjsf-team/react-jsonschema-form/issues/3715
I will do some more profiling and look at ways to mitigate or improve the performance.
Bulk of performance issues are linked to liveOmit
in the RJSF form because liveOmit
runs AJV validator on every change/keystroke.
liveOmit
and omitExtraData
enabled so that extra data gets removed (required for discriminators)liveOmit
: performance improves from 250-350ms per keystroke on an empty Rig to 70-100ms (negligible). For a "filled" sample Rig, improves from 2-2.6s to 350-500ms (acceptable).Mitigation: Disable liveOmit
option in RJSF form
omitExtraData
, just not on each keystroke. When users click submit, RJSF should still first omit extra data, then pass new formData to validator.Blocker: Potential bug in RJSF with omitExtraData
liveOmit
, we now have errors due to extra data that users cannot manually resolve.
Describe the bug A few users have reported noticeable lagging when entering complex rig metadata. For example, dropdowns take a few seconds to render, or the text input would not change the displayed value as the user is typing.
To Reproduce Steps to reproduce the behavior:
Expected behavior We should investigate this and see if it is an issue with rjsf, our custom widgets, or the Rig JSON schema itself.
Desktop (please complete the following information):
Additional context I did a quick comparison and noticed comparable lagging even without the
CustomTextWidget
and also on rjsf playground.