Skip to content

Rust: Cache DataFlow::Node.{toString,getLocation} #19886

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

Merged
merged 1 commit into from
Jun 27, 2025

Conversation

hvitved
Copy link
Contributor

@hvitved hvitved commented Jun 26, 2025

This PR introduces extra caching, to avoid recomputing things in data flow query stages. I also identified an unfortunate recomputation as a result of NodePublic being abstract; the compiler does not know that NodePublic is in fact the same as the entire underlying newtype, so that resulted in a needless charpred with expensive recomputations.

Reduces lines of DIL from 39K to 28.5K for the query stage of CleartextLogging.ql. DCA confirms the DIL reduction for data flow queries.

@github-actions github-actions bot added the Rust Pull requests that update Rust code label Jun 26, 2025
@hvitved hvitved added the no-change-note-required This PR does not need a change note label Jun 26, 2025
@hvitved hvitved force-pushed the rust/dataflow-caching branch from 84343de to b70aa80 Compare June 26, 2025 11:49
@hvitved hvitved marked this pull request as ready for review June 27, 2025 06:42
@Copilot Copilot AI review requested due to automatic review settings June 27, 2025 06:42
@hvitved hvitved requested a review from a team as a code owner June 27, 2025 06:42
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@hvitved hvitved merged commit 3fb8758 into github:main Jun 27, 2025
18 checks passed
@hvitved hvitved deleted the rust/dataflow-caching branch June 27, 2025 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-change-note-required This PR does not need a change note Rust Pull requests that update Rust code
2 participants