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

Map node pool improvements #2108

Merged
merged 7 commits into from
Mar 24, 2019
Merged

Conversation

eggrobin
Copy link
Member

Since MapNodes are costly to Create (proportionally to the number of existing MapNodes),

  • reuse MapNodes as much as possible:
    • make unused nodes invisible instead of terminating them,
    • do not clear the MapNodePool when there is no trajectory to render;
  • limit the number of map nodes of one kind to 64.

Further, fix the execution order issue that caused the nodes to lag behind the trajectories when moving the camera.

// KSP attaches labels to its map nodes, but never detaches them.
// If the node changes type, we end up with an arbitrary combination of
// labels Ap, Pe, AN, DN.
// Recreating the node entirely takes a long time, instead we manually
Copy link
Member

Choose a reason for hiding this comment

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

Let's qualify "long time" for future reference: 50 ns * N where N is the total number of map nodes in existence (can easily be 1000).

@pleroy pleroy added the LGTM label Mar 24, 2019
@eggrobin eggrobin merged commit a75e989 into mockingbirdnest:master Mar 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants