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

Analyze and improve pre-validation steps #138

Open
matt-sheets opened this issue Mar 6, 2023 · 2 comments
Open

Analyze and improve pre-validation steps #138

matt-sheets opened this issue Mar 6, 2023 · 2 comments

Comments

@matt-sheets
Copy link
Collaborator

matt-sheets commented Mar 6, 2023

The pre-validation steps introduced here: #128
are not very optimized and can be improved.

Currently we have what could potentially be a large clone which sizable policy (which ref policy 3 will become) in a while loop that may take several iterations to resolve. I initially did this to avoid mutability & ownership issues. This can be seen in search_for_recursion

I assume there are also general improvements that can go into this function as well.

@dburgener
Copy link
Owner

Can you add a little more specificity? You're talking about performance, and specifically the repeated large clone() I imagine?

@dburgener
Copy link
Owner

I did a first pass at some optimizations here. Converting to a BTreeSet and avoiding removals inside a Vec was a huge (50%) win. Removing the clone() showed no performance improvement. My guess is that maintaining the list of things to remove cost enough that it canceled out the clone() removal. I'm going to submit a PR with the BTreeSet conversion and that speedup, but I'll leave this open for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants