Problem/Motivation

The schema cache is never used on runtime, but every time we install a module, we do a rebuild of it. This takes about 500kb of memory.

Proposed resolution

Just delete the cache item instead.

Remaining tasks

User interface changes

N/A.

API changes

N/A.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

catch’s picture

Status: Active » Needs review
Parent issue: » #2494987: [meta-6] Reduce cold cache memory requirements
FileSize
692 bytes

Status: Needs review » Needs work

The last submitted patch, 1: 2502373.patch, failed testing.

catch’s picture

Status: Needs work » Needs review
FileSize
693 bytes

Backslash.

catch’s picture

Issue summary: View changes
FileSize
177.35 KB

Status: Needs review » Needs work

The last submitted patch, 3: 2502373.patch, failed testing.

catch’s picture

Status: Needs work » Needs review
FileSize
5.58 KB

Let's drop the static cache. This isn't used anywhere in core outside tests and install-related code:

 grep -rl "drupal_get_schema" *
core/includes/common.inc
core/includes/schema.inc
core/includes/update.inc
core/lib/Drupal/Core/Database/Driver/sqlite/Schema.php
core/lib/Drupal/Core/Extension/ModuleInstaller.php
core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php
core/lib/Drupal/Core/Updater/Module.php
core/modules/simpletest/simpletest.module
core/modules/simpletest/src/KernelTestBase.php
core/modules/simpletest/src/Tests/KernelTestBaseTest.php
core/modules/system/src/Tests/Database/InsertDefaultsTest.php
core/modules/system/src/Tests/Module/InstallTest.php
core/modules/system/src/Tests/Module/ModuleTestBase.php
core/modules/system/system.install
core/modules/system/tests/modules/module_test/module_test.install
core/scripts/dump-database-d6.sh
core/scripts/dump-database-d7.sh

Status: Needs review » Needs work

The last submitted patch, 6: 2502373.patch, failed testing.

catch’s picture

Status: Needs work » Needs review
FileSize
7.99 KB

Removing some cruft and updating some more calls.

Status: Needs review » Needs work

The last submitted patch, 8: 2502373.patch, failed testing.

catch’s picture

Status: Needs work » Needs review
FileSize
7.99 KB

Status: Needs review » Needs work

The last submitted patch, 10: 2502373.patch, failed testing.

umarzaffer’s picture

Status: Needs work » Needs review
FileSize
10.21 KB
1.68 KB

Fixing failing tests.

Status: Needs review » Needs work

The last submitted patch, 12: 2502373-12.patch, failed testing.

catch’s picture

Namespacing isn't the problem here. The direct calls to hook_install() relied on drupal_get_schema(NULL, TRUE) having loaded all module install files. We need to load the install files explciitly instead - either in a base test class or just before calling the hook_install() (I didn't look at the individual tests yet).

catch’s picture

Status: Needs work » Needs review
FileSize
9.57 KB

Here it is with that change.

no_angel’s picture

Assigned: Unassigned » no_angel
no_angel’s picture

I need to fix:

Xdebug settings xdebug.max_nesting_level is set to 100.
Set xdebug.max_nesting_level=256 in your PHP configuration as some pages in your Drupal site will not work when this setting is too low.

before testing.

no_angel’s picture

Assigned: no_angel » Unassigned
catch’s picture

Remembered from another issue, that drupal_get_schema() is exclusively used in tests now. So here's a patch to completely remove it.

Major since this is both time and memory, and it will get worse the more modules are on a site (if they implement hook_schema()).

Status: Needs review » Needs work

The last submitted patch, 19: remove_drupal_get_schema.patch, failed testing.

catch’s picture