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

Speed up calculation of jump paths #1006

Conversation

sixlettervariables
Copy link
Collaborator

  • Improve speed by ~4x using a Set instead of a List to track the open/closed lists
  • Improve speed to ~5-7x by adding the visitor pattern to Planets (visitNearbyPlanets)

Random AtB campaign with 20 contracts:

  • Old 37.356 seconds
  • New 5.479 seconds

- Improve speed by ~4x using a Set instead of a List to track the open/closed lists
- Improve speed to ~5-7x by adding the visitor pattern to getNearbyPlanets

Random AtB campaign with 20 contracts:
- Old 37.356 seconds
- New 5.479 seconds
Copy link
Member

@NickAragua NickAragua left a comment

Choose a reason for hiding this comment

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

Oh yeah, much better.

@sixlettervariables sixlettervariables merged commit f89509f into MegaMek:master Dec 23, 2018
@sixlettervariables sixlettervariables deleted the improve-jumppath-performance branch July 22, 2019 19:42
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.

None yet

2 participants