I suggest to add static caching to ctools_content_get_subtype() function.

Comments

maximpodorov’s picture

joelpittet’s picture

Status: Needs review » Reviewed & tested by the community

I like it:) I gave it a test and just cursory look and I save a bit on memory too on larger panels. (Panels Everywhere in my case)

Footer results:
Before (Small Panel with 3 panes)

Page execution time was 1804.24 ms. XHProf output. Memory used at: devel_boot()=8.99 MB, devel_shutdown()=129.67 MB, PHP peak=135.25 MB.
Page execution time was 1967 ms. XHProf output. Memory used at: devel_boot()=8.99 MB, devel_shutdown()=129.81 MB, PHP peak=135.25 MB.

After (Small Panel with 3 panes)

Page execution time was 2116.14 ms. XHProf output. Memory used at: devel_boot()=8.99 MB, devel_shutdown()=129.81 MB, PHP peak=135.25 MB.
Page execution time was 2332.11 ms. XHProf output. Memory used at: devel_boot()=8.99 MB, devel_shutdown()=129.81 MB, PHP peak=135.5 MB.

Before (Large Panels Everywhere)

Page execution time was 4672.27 ms. XHProf output. Memory used at: devel_boot()=8.99 MB, devel_shutdown()=146.2 MB, PHP peak=155.5 MB.
Page execution time was 5203.54 ms. XHProf output. Memory used at: devel_boot()=8.99 MB, devel_shutdown()=139.97 MB, PHP peak=147.75 MB.

After (Large Panels Everywhere)

Page execution time was 3946.28 ms. XHProf output. Memory used at: devel_boot()=8.99 MB, devel_shutdown()=139.99 MB, PHP peak=147.5 MB.
Page execution time was 4494.56 ms. XHProf output. Memory used at: devel_boot()=8.99 MB, devel_shutdown()=139.99 MB, PHP peak=147.5 MB.

joelpittet’s picture

Category: Bug report » Feature request

This is a feature request.

joelpittet’s picture

Status: Reviewed & tested by the community » Needs review

Could use another review from maybe @msonnabaum for the static's memory hostage as a static.

chris matthews’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

The 4 year old patch to content.inc does not apply to the latest ctools 7.x-1.x-dev and if still applicable needs a re-roll.

Checking patch includes/content.inc...
Hunk #1 succeeded at 182 (offset 5 lines).
error: while searching for:
  if ($subtype) {
    ctools_content_prepare_subtype($subtype, $plugin);
  }
  return $subtype;
}

error: patch failed: includes/content.inc:204
error: includes/content.inc: patch does not apply
shubham.prakash’s picture

Status: Needs work » Needs review
StatusFileSize
new789 bytes

Rerolled #1

joelpittet’s picture

Issue tags: -Needs reroll
japerry’s picture

Status: Needs review » Closed (outdated)

Drupal 7 is no longer supported, closing.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.