SFTtech / openage

Free (as in freedom) open source clone of the Age of Empires II engine 🚀
http://openage.dev
Other
12.78k stars 1.12k forks source link

Implement pairing heap without `shared_ptr` #1675

Open heinezen opened 2 months ago

heinezen commented 2 months ago

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 https://github.com/SFTtech/openage/commit/4ab602a6242448bb82eac5db9eafa96d758c7199

Tasks:

valgrind --tool=callgrind ./run test -d pathfinding.tests.path_demo 1

Further Reading

vijayabhaskar78 commented 1 month ago

Can I work on this issue

heinezen commented 1 month ago

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

jere8184 commented 2 weeks ago

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

heinezen commented 2 weeks ago

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

jere8184 commented 2 weeks ago

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

heinezen commented 2 weeks ago

I think we can just replace it.

TheJJ commented 2 weeks ago

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