Comments

tstoeckler’s picture

Status: Active » Needs review
StatusFileSize
new4.23 KB

Here we go. Most of the changes are pretty non-controversial, I think. The Features Import will suffer a performance decrease after this, because previously the caches were only cleared once after saving all entity types. Now the caches are cleared multiple times. Especially the schema cache clearing and menu rebuilding are heavy I think.

For the latter, though, we shouldn't be calling menu_rebuild() ourselves but doing variable_set('menu_rebuild_needed', TRUE);

Follow-up for that coming.

tstoeckler’s picture

StatusFileSize
new688 bytes
new4.28 KB

Here we go. Now the only notable performance decrease is the schema cache clear. Without having benchmarked that, though, I think that's an acceptable drawback to this consolidation of code and (arguably) a bug fix (from the perspective of an API consumer).

tstoeckler’s picture

Status: Needs review » Needs work
tstoeckler’s picture

StatusFileSize
new702 bytes
new4.85 KB

Here we go. Bundle did not have a delete() yet, so I added it.

tstoeckler’s picture

Status: Needs work » Needs review

Setting to needs review again.

kaizerking’s picture

This worked

acrazyanimal’s picture

Status: Postponed (maintainer needs more info) » Needs review

Thanks for all the work on this. Its great to have the extra eyes on it.

To clarify, the reason I put the cache clearing in the form submits was that it was more efficient that way. I figure anyone using the API could just call EntityType::loadAll(NULL, TRUE) and Bundle::loadAll(NULL, TRUE) after creating/deleting/updating their entities. It would actually be more efficient that way as well, because you'd only call it once after you've performed the actions in code and you're all finished.

Any thoughts?

acrazyanimal’s picture

Status: Needs review » Postponed (maintainer needs more info)

@tstoeckler I committed the fixes you added for clearing the menu using the menu_rebuild_needed variable and for resetting the schema cache on bundle delete, but I'm reluctant to add the changes for clearing the ECK caches within the entity objects.

acrazyanimal’s picture

For reference the commit of the menu and schema cache rebuilding is here: http://drupalcode.org/project/eck.git/commit/c99e975

tstoeckler’s picture

Status: Needs review » Postponed (maintainer needs more info)

I'm personally not married to the cache clearing in the API functions, but I do think it is clearer conceptually.
If you're concerned about Performance we could do the cache clearing in shutdown functions. That would probably done in a similar fashion to the 'menu_rebuild_needed' variable. We could simply set a 'entity_cache_rebuild' (or a better name thereof) variable and if that is set, to do all that cache clearing in 'eck_shutdown_function'. Thoughts?

  • Commit 4dd908f on 7.x-3.x authored by tstoeckler, committed by fmizzell:
    Issue #1979658 by tstoeckler: Set the variable 'menu_rebuild_needed'...

  • Commit c99e975 on 8.x authored by tstoeckler, committed by acrazyanimal:
    Issue #1979658 by tstoeckler: Set the variable 'menu_rebuild_needed'...

  • fmizzell committed 4dd908f on 8.x-1.x authored by tstoeckler
    Issue #1979658 by tstoeckler: Set the variable 'menu_rebuild_needed'...
legolasbo’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Closed (duplicate)

Closing old issues. Please reopen the issue with a clear description and/or steps to reproduce if this issue is still relevant.

legolasbo’s picture

Status: Closed (duplicate) » Closed (cannot reproduce)