Skip to content

Conversation

Adnan-cds
Copy link
Contributor

@Adnan-cds Adnan-cds commented Dec 12, 2020

Apparently, we missed a slash character from the SQLite file's path.

Current path: sqlite://localhost/dev/shm/test.sqlite
Proposed path: sqlite://localhost//dev/shm/test.sqlite

@see https://git.drupalcode.org/project/drupal/-/blob/9.2.x/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php#L473
@see https://git.drupalcode.org/project/drupal/-/blob/9.2.x/core/tests/Drupal/Tests/Core/Database/Driver/sqlite/ConnectionTest.php#L44

I stumbled up on the above links while trying to troubleshoot localgov_subsites' test failures although this change won't help the localgov_subsites one.

This proposed change has brought down the test run time to under 16 minutes from the previous 25+ minutes. So not bad. I am still praying for a sub 10 minute run :)

Another option is to try sqlite://localhost/:memory: leading SQLite to create a temporary database directly in the memory. This completely avoids the Operating system's disk API putting SQLite in more direct control. This is supposed to improve SQLite's performance even further although I haven't noticed any difference in my local development site. That's why I am sticking with a file system based URL.

Copy link
Member

@finnlewis finnlewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brilliant @Adnan-cds 👍

@Adnan-cds
Copy link
Contributor Author

Thanks Finn. Merging...

@Adnan-cds Adnan-cds merged commit cb21e1d into master Jan 6, 2021
@stephen-cox stephen-cox deleted the fix/sqlite-shared-memory-path branch May 18, 2021 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants