Skip to content

[TASK] Bulk insert functional database snapshots - #745

Open
wouter90 wants to merge 1 commit into
TYPO3:mainfrom
wouter90:bulk-functional-snapshot-imports
Open

[TASK] Bulk insert functional database snapshots#745
wouter90 wants to merge 1 commit into
TYPO3:mainfrom
wouter90:bulk-functional-snapshot-imports

Conversation

@wouter90

Copy link
Copy Markdown
Contributor

Database snapshot restoration currently executes one INSERT statement for every saved row. Snapshot-heavy test cases therefore spend much of their setup time on database round trips.

Restore each table through Connection::bulkInsert() instead. The connection preserves the existing type conversion and automatically chunks statements at the database platform's parameter limit.

For the 173-test SlugLinkGeneratorTest on MariaDB, runtime decreases from 6:06.929 to 1:59.403, saving 4:07.526 or 67.5%. The same test passes on PostgreSQL in 1:03.907.

Database snapshot restoration currently executes one INSERT statement for every saved row. Snapshot-heavy test cases therefore spend much of their setup time on database round trips.

Restore each table through Connection::bulkInsert() instead. The connection preserves the existing type conversion and automatically chunks statements at the database platform's parameter limit.

For the 173-test SlugLinkGeneratorTest on MariaDB, runtime decreases from 6:06.929 to 1:59.403, saving 4:07.526 or 67.5%. The same test passes on PostgreSQL in 1:03.907.
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.

1 participant