-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Make extract_toplevel_blocks() Faster #9045
Conversation
…ially for large files.
Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide. |
1 similar comment
Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #9045 +/- ##
==========================================
- Coverage 86.55% 86.52% -0.04%
==========================================
Files 179 179
Lines 26538 26555 +17
==========================================
+ Hits 22971 22977 +6
- Misses 3567 3578 +11
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
…faster. Duplicate the change from dbt-labs/dbt-core#9045 into dbt-common
Have replicated the changes in #9045 in a new PR for This change reduces @gshank @peterallenwebb Anything else I would need to do for the PR? My company (Oda) has already signed the CLA. |
…faster. Duplicate the change from dbt-labs/dbt-core#9045 into dbt-common
…faster. Duplicate the change from dbt-labs/dbt-core#9045 into dbt-common
…faster. Duplicate the change from dbt-labs/dbt-core#9045 into dbt-common
This was ultimately resolved in: dbt-labs/dbt-common#205 |
resolves #9037
Problem
The extract_toplevel_blocks() function was a severe bottleneck for some large-ish (>100Kb) files.
Solution
By caching string search results instead of re-search many times, we were able to accelerate performance by >500x on a file of size ~500Kb, from 15s to .039s.
Checklist