Skip to content

Commit

Permalink
Fix performance issue where an early bad out isn't available for part…
Browse files Browse the repository at this point in the history
…ially-shared incomplete paths.
  • Loading branch information
marcushutchings committed Dec 4, 2023
1 parent 2cc591c commit 35a026a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rts/Sim/Path/QTPFS/PathSearch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ void QTPFS::PathSearch::LoadPartialPath(IPath* path) {
// explicitly doesn't capture the step index if it hits an early drop out.
});
}
expectIncompletePartialSearch = (badNodeCount > 0);
}

// #pragma GCC pop_options
Expand Down Expand Up @@ -454,6 +455,9 @@ bool QTPFS::PathSearch::ExecutePathSearch() {
searchThreadData->ResetQueue(SearchThreadData::SEARCH_FORWARD);
searchThreadData->ResetQueue(SearchThreadData::SEARCH_BACKWARD);
}
// We're done with the forward path and we expect the reverse path to fail so stop it right there.
if ((*fwd.openNodes).empty() && expectIncompletePartialSearch)
searchThreadData->ResetQueue(SearchThreadData::SEARCH_BACKWARD);
}

if (!(*bwd.openNodes).empty()) {
Expand Down
1 change: 1 addition & 0 deletions rts/Sim/Path/QTPFS/PathSearch.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ namespace QTPFS {
bool doPartialSearch = false;
bool rejectPartialSearch = false;
bool allowPartialSearch = false;
bool expectIncompletePartialSearch = false;
bool searchEarlyDrop = false;
bool initialized = false;
bool partialReverseTrace = false;
Expand Down

0 comments on commit 35a026a

Please sign in to comment.