-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performance problems with allOf #4051
Comments
Could this be a reason? |
@magaton the |
@heath-freenome, thanks for the answer. It would be very helpful if you could tell me what I need to change locally to eliminate those excessive Thanks |
@heath-freenome I have realized it is not about |
@magaton Feel free to come to the RJSF meeting today at 12pm PST to talk about this |
@magaton or we could chat one-on-one via Discord. |
Prerequisites
What theme are you using?
mui
Version
5.16.1
Current Behavior
When using
allOf
subschemas are validated multiple times for each render, no matter if the controlling field (whereallOf
is placed) has been changed or not.This results in many. in the complete version, hundreds of unnecessary calls of
isValid()
invalidator.ts
.Moreover, in
validator.ts
, if I remove the comment from this line, the caching of rootSchema is enabled.This helps a bit since rootSchema is not validated for each render, but subschemas are validated, although compiled only once (initially) since their compiled validator is found in the cache.
I have tried to figure out what is causing this. I have looked in MultischemaField, but could not understand why subschemas are validated for each render, multiple times. Also, I have tried to add a discriminator, hoping that this would skip calling
isValid
, but no luck, since my controlling fields are usually arrays andallOf
is usingcontains
.My battle with performance is really a long one:
but this time, I think I was able to identify the problem.
It is not a compile problem, compilers are cashed by generated hash, but numerous
isValid
calls.Could you please help, at least by pointing out what is causing this and what could be the solution for this problem, so that, at least, users can use my application? Now it is terribly slow and laggy on each keystroke.
Thanks in advance.
Expected Behavior
I would expect that isValid is called only once per each render, if and only if the controlling field value has been changed.
Steps To Reproduce
Please check the repo demonstrating this problem. You will be able to see numerous
isValid
calls for each subschema in everyallOf
, no matter whether it is an initial render or change in a completely irrelevant field.Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: