We are using a few menu_minipanels with panels entity form elements, and a static cache here saves us ~1 second per page load. The patch is straightforward:

diff --git a/plugins/content_types/form/entity_form_field.inc b/plugins/content_types/form/entity_form_field.inc
index 56fb76a..fa0292c 100644
--- a/plugins/content_types/form/entity_form_field.inc
+++ b/plugins/content_types/form/entity_form_field.inc
@@ -29,8 +29,11 @@ function ctools_entity_form_field_content_type_content_type($subtype) {
  * Return all field content types available.
  */
 function ctools_entity_form_field_content_type_content_types() {
+  $types = &drupal_static(__FUNCTION__, array());
+  if (!empty($types)) {
+    return $types;
+  }
   // This will hold all the individual field content types.
-  $types = array();
   $content_types = array();
   $entities = entity_get_info();

See: #1243540: Add static cache to ctools_entity_field_content_type_content_types

I do think there is a slightly related problem where each instance of a field on a panel/mini-panel is a rendering of the entire content type's form, instead of maybe rendering it once into a cache and re-using the same $form?

Comments

miroslavbanov’s picture

Issue summary: View changes
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.