Skip to content

add DP to incoming and outgoing#18

Open
jobeland wants to merge 2 commits intoangshuman:add-dp-to-incoming-outgoingfrom
jobeland:outgoing-incoming-dp
Open

add DP to incoming and outgoing#18
jobeland wants to merge 2 commits intoangshuman:add-dp-to-incoming-outgoingfrom
jobeland:outgoing-incoming-dp

Conversation

@jobeland
Copy link
Collaborator

This change adds tracking for nodes already visited and nodes already matched when exploring the graph via outgoing/incoming constraints in aim to help reduce time and unnecessary calls to the store. At scale, this seemed to reduce calls to 1/3 (~300K to ~100K) and increased the memory footprint by ~200MB during calculation

PR is for a side branch for now and we can review later if we want to bring this into master

@jobeland jobeland requested a review from angshuman December 16, 2019 22:50
@jobeland jobeland self-assigned this Dec 16, 2019
var matched = source.Where(x =>
{
IEnumerable<string> targets;
IDictionary<string, ISet<string>> targets;
Copy link
Collaborator

@emgarten emgarten Dec 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: it would be better for perf to use Dictionary<string, HashSet<string>> for anything that isn't exposed externally

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got sidetracked. Thanks for the feedback, updated in b0701ad

@emgarten
Copy link
Collaborator

This looks like a great improvement 💯

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.

2 participants