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

Closed
2 tasks
heinezen opened this issue Aug 25, 2024 · 8 comments
Closed
2 tasks

Implement pairing heap without shared_ptr #1675

heinezen opened this issue Aug 25, 2024 · 8 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 moved this to pathfinder in openage beginner tasks Aug 25, 2024
@heinezen heinezen added the hacktoberfest For newcomers from Hacktoberfest event label Sep 20, 2024
@vijayabhaskar78
Copy link

Can I work on this issue

@heinezen
Copy link
Member Author

@vijayabhaskar78 Yes, you can. Do you have knowledge of C++? It's not the easiest beginner task for someone new to C++.

@jere8184
Copy link
Contributor

jere8184 commented Nov 6, 2024

@heinezen I would like to pick this up if its still available

@heinezen
Copy link
Member Author

heinezen commented Nov 6, 2024

@jere8184 it is available and it would be a nice addition :)

@jere8184
Copy link
Contributor

jere8184 commented Nov 6, 2024

Great, should I keep the shared pointer implementation or replace it?

@heinezen
Copy link
Member Author

heinezen commented Nov 6, 2024

I think we can just replace it.

@TheJJ
Copy link
Member

TheJJ commented Nov 6, 2024

you can replace it, so that one can add shared pointers as the contained element type - then we have both available!

@heinezen heinezen linked a pull request Nov 18, 2024 that will close this issue
@heinezen
Copy link
Member Author

heinezen commented Dec 2, 2024

Resolved in #1713

@heinezen heinezen closed this as completed Dec 2, 2024
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in openage game simulation Dec 2, 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
Archived in project
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants