Skip to content

Migration performance correlated to number of migration files #4136

@artman

Description

@artman

Issue type:

[ ] question
[x] bug report
[ ] feature request
[ ] documentation issue

Database system/driver:

[ ] cordova
[ ] mongodb
[ ] mssql
[ ] mysql / mariadb
[ ] oracle
[x] postgres
[ ] cockroachdb
[ ] sqlite
[ ] sqljs
[ ] react-native
[ ] expo

TypeORM version:

[x] latest
[ ] @next
[ ] 0.x.x (or put your version here)

Steps to reproduce or a small repository showing the problem:

We've got a pretty large TS project with 50 migration files and have been experiencing a gradual slowdown in running any migration.

For example yarn typeorm -f .ormconfig migration:run used to take just under 10 seconds a few months ago, but now its takin 120 seconds even if there are no migrations to run.

Similarly, generating migrations has been slowing down and is also now taking 120 seconds.

Some of the slowdown is obviously because of increase TS compile time of the project, but there is a distinct correlation between the performance of the migrator and the number of migration files in the project.

Deleting all but the latest migration files will decrease the 120-second migration time to 15 seconds. The TS compile time for these migrations is just a few seconds, so it seems that TypeORM is doing some unnecessary work for each added migration file.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions