Skip to content
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

Inheritence performance issue #4997

Open
jremmurd opened this issue Sep 19, 2019 · 0 comments

Comments

@jremmurd
Copy link
Contributor

commented Sep 19, 2019

Improvement Request

Saving an object with localized fields, a lot of child-nodes and inheritence enablde, the doUpdate() method in https://github.com/pimcore/pimcore/blob/master/models/DataObject/Concrete/Dao/InheritanceHelper.php#L203 may take over 10 seconds for each language. In our case there where about 210.000 child nodes and 10 languages. So saving the object even though nothing changed and not even a single field contained any data took several minutes. To me the main levers are in the following code sections:

  1. https://github.com/pimcore/pimcore/blob/master/models/DataObject/Concrete/Dao/InheritanceHelper.php#L361
    a) Loading several thousands of ids at once takes some time: https://github.com/pimcore/pimcore/blob/master/models/DataObject/Concrete/Dao/InheritanceHelper.php#L367
    b) Recursive iteration and building the std class tree takes a lot of time: https://github.com/pimcore/pimcore/blob/master/models/DataObject/Concrete/Dao/InheritanceHelper.php#L394
  2. Performing an IN mysql statement on an array containing a quater of a million ids also takes a lot of time and may even exceed the max query length max_allowed_packet.

I gues there are several options for improvement:

  1. Improve the dirty detection and only perform a data save if data actually changed.
  2. Optimize queries and data structures mentioned above

This issue may be related to #4154.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.