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

store StrandPair instead of Tuple[Strand, Strand] in ConstraintWithStrandPairs and make _determine_strand_pairs_to_check more efficient #209

Open
dave-doty opened this issue Jul 21, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@dave-doty
Copy link
Member

Profiling shows a lot of time is spent here. Seems like this part could be changed from quadratic to linear:

        if constraint.pairs is not None:
            for strand1, strand2 in constraint.pairs:
                for domain_changed in domains_changed:
                    if domain_changed in strand1.domains or domain_changed in strand2.domains:
                        strand_pairs_to_check.append(StrandPair(strand1, strand2))
                        break  # ensure we don't add the same strand pair twice
@dave-doty dave-doty added the enhancement New feature or request label Jul 21, 2022
@dave-doty dave-doty self-assigned this Jul 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
1 participant