-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parsing database changelogs got much slower in versions following 4.21.1 #4957
Comments
Hello @metamben, thank you for bringing this issue to our attention. It's definitely something we're interested in improving. I was able to reproduce what you reported, and I'll be forwarding this ticket to the development team so they can evaluate how to move forward. |
Perhaps unsurprisingly, the commit where the performance degraded was 831135b Parsing my changelog the first time jumps from 492ms to 1,011ms. More importantly, subsequent parsing jumps from 41ms to 370ms. We have a lot of integration tests, each of which applies the changelog to a DB, so that extra 330ms a run quickly adds up. |
While looking for something else, I happened to be walking the code with 4.23.2 and observed that in src/main/java/liquibase/util/StringUtil.java, processMultiLineSQL() appears to be called 2-3 times per SQL string while parsing SQL from a sql or sqlFile tag in a changeset. I have not delved into that sufficiently to file a solid bug report, but it looks like something that could reduce performance. Maybe it is related to this. |
Thanks for the sample code @metamben , @Mahoney for the merge and for the multiple calls insight from @erasmussen-first ! I think it's fixed now - at least my results with the artifacts from #5090 are almost same as 4.21.1. It was a tricky bug - hard to find, easy to fix.
|
Thanks, great spot! Yes, that returns my build to the previous speeds - great work. (For anyone else wanting to check, you need to declare a new repository |
Search first
Description
In Metabase we are trying to upgrade Liquibase from 4.11.0 to 4.23.2. Unfortunately, running the DB migration tests takes about six times longer.
Profiling revealed the parsing of the migration file as the bottleneck (see metabase/metabase#33891 for details).
Steps To Reproduce
mvn clean package exec:java
and observe how long the parsing takespom.xml
, change the liquibase version to4.21.1
mvn clean package exec:java
and observe how much less time the parsing takesliquibase-4.23-slow-parse.zip
Expected/Desired Behavior
No obvious slowdown or a work around to get about the same speed as 4.11.0.
Liquibase Version
4.23.2
Database Vendor & Version
N/A
Liquibase Integration
API
Liquibase Extensions
No response
OS and/or Infrastructure Type/Provider
MacOS Ventura 13.5.2 (22G91)
Additional Context
No response
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: