perf: avoid calling Matching::add
in a loop #329
No reviewers
Labels
No labels
Compat/Breaking
Kind
Bad merge
Kind
Bug
Kind
Documentation
Kind
Enhancement
Kind
Feature
Kind
New language
Kind
Security
Kind
Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: mergiraf/mergiraf#329
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "ada4a/mergiraf:matching_avoid_add"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
It calls
HashMap::insert
internally. One should avoid calling thatmethod in a loop, and instead pass the iterator into
HashMap::extend
,so that the map can (hopefully) preallocate enough space.
This PR introduces
Matching::extend
which does exactly that.The other thing
Matching::add
does is callMatching::remove
, which Icouldn't find a way to "serialize", so it's still called in the loop.
That can be an area for further improvement.
perf(Matching): avoid calingto perf: avoid calingSelf::add
in a loopMatching::add
in a loopperf: avoid calingto perf: avoid callingMatching::add
in a loopMatching::add
in a looprebased onto main
4ad971eccc
to803e3fab50