You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Setting up a cr will take some time. This is due to our implementation of creating the database tables of the projections:
$schemaDiff = (newComparator())->compare($schemaManager->createSchema(), $schema);
// toSaveSql to not drop other tables found in the databaseforeach ($schemaDiff->toSaveSql($connection->getDatabasePlatform()) as$statement) {
$connection->executeStatement($statement);
}
In each projection setup we will call $schemaManager->createSchema() twice. Once for the main tables and once for the checkpoint lock tables. This is super expensive as it has to go through all tables and their columns and indexes uncached – even though we are only interested in one or two tables per projection.
Additionally this pattern is deprecated with doctrine/dbal 3+
reduced the runtime of a single instance from 0.08 s to 0.0012 s.
This seems like a very quick win.. And that code might even safely be runtime-cached because it only affects the given table(s)
Currently this affects also our testing execution time. By hacking around and making assumptions we can cleverly cache it but it would be great to not have to go through the trouble of #4750
Extracted from earlier discussions:
Another alternative to speed up the setup would naively be to somehow cache the createSchema calls and dont optimize the $cr->setUp(). That would have a high performance gain, but it comes with a downside as @bwaidelich said:
There is most certainly a lot of potential for speed improvements, but we should be careful not to let them degrade the system architecture.
E.g. I would suggest not to cache the createSchema call even though it might be tempting because that can lead to caching issues (you might have heard of them).
Setting up a cr will take some time. This is due to our implementation of creating the database tables of the projections:
In each projection setup we will call
$schemaManager->createSchema()
twice. Once for the main tables and once for the checkpoint lock tables. This is super expensive as it has to go through all tables and their columns and indexes uncached – even though we are only interested in one or two tables per projection.Additionally this pattern is deprecated with
doctrine/dbal
3+@bwaidelich fiddled a bit with the whole schema diffing, and found that changing
to
reduced the runtime of a single instance from 0.08 s to 0.0012 s.
This seems like a very quick win.. And that code might even safely be runtime-cached because it only affects the given table(s)
Currently this affects also our testing execution time. By hacking around and making assumptions we can cleverly cache it but it would be great to not have to go through the trouble of #4750
Extracted from earlier discussions:
Another alternative to speed up the
setup
would naively be to somehow cache thecreateSchema
calls and dont optimize the$cr->setUp()
. That would have a high performance gain, but it comes with a downside as @bwaidelich said:Related: #4388
The text was updated successfully, but these errors were encountered: