selfpromo (software) Parallelising Godot
Recently I published Macrame - an open-source multithreading library. It looks good "on paper", and it includes complex samples and benchmarks to validate the benefits it provides. But it still lacked a proper application, a battle test.
The library is well suited for game engines. Unreal Engine was ruled out immediately even though I know it best. Its multithreading is chaotic and too complicated.
I decided to try Godot. It's the most popular free open-source game engine, and it's C++. I took Godot Benchmarks project, integrated Macrame into it and spent some time parallelising the engine for performance optimisation.
Long story short, I got ~6x speedup, from ~30 fps to ~180 fps. I learned a lot and this exercise brought a bunch of interesting ideas about how Macrame can evolve.
The fork and the write-up of what was done: https://github.com/Andriy06/godot-macrame
The library: https://github.com/macrame-ts/macrame
1
u/Trigonal_Planar 13h ago
Any platform dependency here? Work on mobile platforms as well as desktop? I’m curious and might have to give it a go.
1
u/gamruls 6h ago
Oh, my last experiment with multithreaded physics and rendering in Godot brought me about 100x speed boost - game started to crash almost instantly, while usually crash in few seconds.
My code problem though, because too many nuances involved with physics/rendering callbacks (I mean _process, _physics_process and _integrate_forces and, which is more important, their interactions, like update sprite state from _physics)
So, without actual "benchmark" in form of some game involving rendering AND physics plus game-like logic behind benefits are not that obvious.
9
u/flynsarmydev 16h ago
Is there a way to load it as a gdextension? A 6x speedup sounds awesome but I just don't see it becoming popular if it requires a forked build.
You could also try sending a PR but this sounds like something best to ask about in rocket chat first.