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

Implement pairing heap without shared_ptr #1675

Open
2 tasks
heinezen opened this issue Aug 25, 2024 · 0 comments
Open
2 tasks

Implement pairing heap without shared_ptr #1675

heinezen opened this issue Aug 25, 2024 · 0 comments
Labels
area: simulation Involved in the game mechanics and simulation good first issue Suitable for newcomers hacktoberfest For newcomers from Hacktoberfest event improvement Enhancement of an existing component just do it You can start working on this, there should be nothing left to discuss lang: c++ Done in C++ code

Comments

@heinezen
Copy link
Member

Required Skills: C++

Difficulty: Hard

openage provides a pairing heap implementation that is mostly used in the A* algorithm of our pathfinder. Currently, nodes on the heap are connected using shared_ptr. However, we have noticed that the creation of shared_ptr objects when using the heap is very slow. A variant with raw pointers and without shared_ptr may offer better performance benefits.

A previous implementation already used raw pointers. You can see it in commit 4ab602a

Tasks:

  • Implement the pairing heap without using shared_ptr or enable_shared_from_this. You can use the implemenation in 4ab602a as a reference but be aware that other parts of the code may have changed since then.
  • Use callgrind to compare the speed of the old implementation with your solution that uses precomputed graphs:
valgrind --tool=callgrind ./run test -d pathfinding.tests.path_demo 1

Further Reading

@heinezen heinezen added improvement Enhancement of an existing component lang: c++ Done in C++ code area: simulation Involved in the game mechanics and simulation good first issue Suitable for newcomers just do it You can start working on this, there should be nothing left to discuss labels Aug 25, 2024
@heinezen heinezen added the hacktoberfest For newcomers from Hacktoberfest event label Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: simulation Involved in the game mechanics and simulation good first issue Suitable for newcomers hacktoberfest For newcomers from Hacktoberfest event improvement Enhancement of an existing component just do it You can start working on this, there should be nothing left to discuss lang: c++ Done in C++ code
Projects
Status: pathfinder
Status: 📋 Backlog
Development

No branches or pull requests

1 participant