-
Notifications
You must be signed in to change notification settings - Fork 46
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
Model::validateEntityScope() should not fetch/compute any data #1093
Comments
@mvorisek Can confirm that this dramatic performance loss with added references in models is happening, especially if you have lots of cascaded hasOne relations with added fields of each hasOne references. |
@mkrecek234 I debug the repro steps on atk4/ui as described above and the problem is not reference travesing. With deeper nesting, the query is not becoming larger and larger. The repro here does use hasMany. For hasOne please submit a separate issue. The problem here is:
and
the fields should not be definitely computed on scope validation if there are not a part of validated scope (there are not) and in general, we might introduce something like "lazy fields", fields computed on the 1st access only. also the performance graph above shows the query render might not be the fastest, so this should be investigated as well, but please note the real query render is lower, as the performance measurement itself imply significant overhead |
can be reproduced on https://github.com/atk4/ui/blob/03a9d65ff32602493ecf9980d740fa3f8fc5e21f/demos/init-db.php#L403
NOTES:
data/src/Model.php
Line 1575 in dfa5de5
$entity->SubFolder->import...
to$entity->getModel()->import...
, the total import time is about 10x faster (measured /wo xdebug/profiling)The text was updated successfully, but these errors were encountered: