Skip to content

Speed up pair enumeration - #1

Merged
FabianKruger merged 2 commits into
mainfrom
speed-up-pair-enumeration
Jul 28, 2026
Merged

Speed up pair enumeration#1
FabianKruger merged 2 commits into
mainfrom
speed-up-pair-enumeration

Conversation

@FabianKruger

Copy link
Copy Markdown
Collaborator

Template selection previously scanned all ~9.6k templates for every reactant pair. This builds an inverted index from (left_req, right_req) requirement pairs to template indices once at construction, so each pair does O(|keys1| × |keys2|) lookups instead.

Also parses each unique SMILES once per call rather than once per pair occurrence, and ships the parsed Mol objects to parallel workers. Each batch receiving only the molecules it actually references.

Products and their ordering are unchanged. test_equivalent_to_scanning_orders_for_template asserts the index finds exactly what the old scan did across arbitrary key sets.

@FabianKruger
FabianKruger merged commit fa96dd1 into main Jul 28, 2026
1 check passed
@FabianKruger
FabianKruger deleted the speed-up-pair-enumeration branch July 28, 2026 20:07
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

Successfully merging this pull request may close these issues.

1 participant