data icon indicating copy to clipboard operation
data copied to clipboard

Model::validateEntityScope() should not fetch/compute any data

Open mvorisek opened this issue 2 years ago • 2 comments

can be reproduced on https://github.com/atk4/ui/blob/03a9d65ff32602493ecf9980d740fa3f8fc5e21f/demos/init-db.php#L403

image

NOTES:

  1. the performance graph above is with https://github.com/atk4/data/blob/dfa5de573036a56717fd836b7db4a910ba257f8d/src/Model.php#L1575 commented (otherwise 2x slower, as data are fetched 1 more time)
  2. when the L403 is changed from $entity->SubFolder->import... to $entity->getModel()->import..., the total import time is about 10x faster (measured /wo xdebug/profiling)

mvorisek avatar Feb 16 '23 23:02 mvorisek