Skip to content
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

[CT-1881] [Feature] When possible, bypass an expensive method during graph construction #6697

Closed
3 tasks done
dbeatty10 opened this issue Jan 23, 2023 · 1 comment · Fixed by #6694
Closed
3 tasks done
Labels
enhancement New feature or request performance

Comments

@dbeatty10
Copy link
Contributor

Is this your first time submitting a feature request?

  • I have read the expectations for open source contributors
  • I have searched the existing issues, and I could not find an existing issue for this feature
  • I am requesting a straightforward extension of existing dbt functionality, rather than a Big Idea better suited to a discussion

Describe the feature

#6073 describes how projects with 1000's of nodes can take ~15 minutes to dbt build even a single node.

The _already_known method call is a relatively expensive method call during DAG parsing. There are some cases where it is unnecessarily called, namely when in_degree != 0 here.

Swapping the conditions of the if statement would short-circuit calling _already_known while keeping the logic the same. This is shown in 9f96087. (We know we can safely swap the order by commutativity of conjunction).

Describe alternatives you've considered

There's at least two alternatives:

  1. Default approach of changing nothing
  2. More complicated refactor

This proposal seems obviously superior to the first alternative while not preventing us from taking up the second alternative at a later date. So it's an easy win.

Who will this benefit?

This will (slightly) benefit teams with very large DAGs (thousands of nodes).

Are you interested in contributing this feature?

There's already a PR ready for this!

Anything else?

No response

@dbeatty10 dbeatty10 added enhancement New feature or request triage labels Jan 23, 2023
@github-actions github-actions bot changed the title [Feature] When possible, bypass an expensive method during parsing [CT-1881] [Feature] When possible, bypass an expensive method during parsing Jan 23, 2023
@jtcohen6 jtcohen6 changed the title [CT-1881] [Feature] When possible, bypass an expensive method during parsing [CT-1881] [Feature] When possible, bypass an expensive method during graph construction Jan 23, 2023
@jtcohen6
Copy link
Contributor

Renamed the issue just to make clear that this is graph generation, not project parsing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request performance
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants