On Drupal.org, the panelizer_node:section_allowed_types and panelizer_node:page_allowed_types variables are 71,288 and 71,170 characters respectively. This goes into the variables table cache and is unserialized on every page request. We have that cached in MemCache, which we have configured with a maximum size of 1M. If we had ~10-13 of these stored, the cache would no longer be usable.

Filtering out unselected values like 'views-message' => 0, is doable, when the “New content behavior” option is not selected.

For the rest, Drupal checkboxes’s values are the same as the key, storing only the boolean is needed.

CommentFileSizeAuthor
#2 2671438.diff1.45 KBdrumm

Comments

drumm created an issue. See original summary.

drumm’s picture

Status: Active » Needs review
StatusFileSize
new1.45 KB

Attached is a patch for this, along with code cleanup in the first 2 changed lines.

drumm’s picture

For Drupal.org's use case, aggressively limiting allowed types, this gets the variable sizes down to 1,806 and 1,511 characters, which is quite reasonable. That's about 2.5% of the original size. http://cgit.drupalcode.org/drupalorg/commit/?id=338fee0 is our diff via strongarm/Features.

  • japerry committed d26f9f5 on 7.x-3.x authored by drumm
    Issue #2671438 by drumm: More-efficiently store *_allowed_types...
japerry’s picture

Status: Needs review » Fixed

Passed my local testing, and in theory shouldn't cause any issues except panels strongarm settings will change when exported. Thats probably fine, features does the same thing.

Fixed!

Status: Fixed » Closed (fixed)

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