we are using JsonForms in react, thanks for building it!
But in our use case, we might be having a lot of JsonForms, in long lists. isUniqueId seems to be eating a lot of the CPU cycles, especially “usedIds.has(newID)”.
When rendering 1000 forms on the same page this is using 500ms alone, while the whole rendering seems to take 1500ms.
As id generation seems to be a rather common issue, isnt there a better approach for this around? The generated id is used in JsonFormsDispatchRenderer.
Are all your JSON Forms instances rendering a similar schema? Our createId will be pretty bad in case the iteration count becomes very large. Usually that should not be the case as the ids are based on the data paths and should therefore be mostly unique, but for a large amount of similar forms you might run into that problem.
Sadly the dispatching can’t be easily exchanged. You would need to provide a custom renderer for all renderers which dispatch, i.e. array and layout renderer, and in there invoke an own custom dispatcher which does not invoke reateId. Also createId is invoked by the control bindings, so you would also need to use a custom one there.
It would probably be nice to make the id generation customizable in JSON Forms, for example by handing over an own function there. Would that be something which you would like to contribute?