-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Labels
perfPerformance issuePerformance issue
Description
Following #2792 we are copying a HashMap into a BTreeMap to maintain determinism, as the HashMap (NodeLinkingDirectives) is a public type alias. Changing this to BTreeMap would be breaking but would allow avoiding the copy, here:
hugr/hugr-core/src/hugr/linking.rs
Lines 44 to 52 in 370dbc2
| // (This may be slow for large numbers of module-children, but not total size of Hugr) | |
| let mut nodes = BTreeSet::new(); | |
| if parent.is_some() { | |
| nodes.extend(other.entry_descendants()); | |
| } | |
| nodes.extend(children.iter().flat_map(|(&ch, dirv)| match dirv { | |
| NodeLinkingDirective::Add { .. } => Either::Left(other.descendants(ch)), | |
| NodeLinkingDirective::UseExisting(_) => Either::Right(std::iter::once(ch)), | |
| })); |
Metadata
Metadata
Assignees
Labels
perfPerformance issuePerformance issue