Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

routing: maintain in-memory graph for path finding #5389

Closed
Roasbeef opened this issue Jun 16, 2021 · 0 comments · Fixed by #5642
Closed

routing: maintain in-memory graph for path finding #5389

Roasbeef opened this issue Jun 16, 2021 · 0 comments · Fixed by #5642
Assignees
Labels
beginner Issues suitable for new developers database Related to the database/storage of LND optimization P2 should be fixed if one has time routing
Milestone

Comments

@Roasbeef
Copy link
Member

As is, we'll end up going to disk each time we need to do path finding. This is slower due to the memory remappings, and explicit kernel <-> user context switches this causes. In addition, due to the nature of boltdb, if a read transaction is active, all write transactions are blocked, which may slow down other operations.

Rather than seek each time, we should instead retain a simple, minimal (shed all information from the edge not needed for path finding), in-memory graph based off the existing graph interface.

The new data-structure will need to be concurrent safe and also write through any updates of the graph to the on-disk persistent storage. A new flag should be added to gate this behavior.

@Roasbeef Roasbeef added beginner Issues suitable for new developers database Related to the database/storage of LND routing optimization labels Jun 16, 2021
@Roasbeef Roasbeef added this to the v0.14.0 milestone Jun 16, 2021
@ellemouton ellemouton self-assigned this Jun 24, 2021
@Roasbeef Roasbeef added the P2 should be fixed if one has time label Aug 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginner Issues suitable for new developers database Related to the database/storage of LND optimization P2 should be fixed if one has time routing
Projects
None yet
3 participants