Hi! My name is Carlos, I’m a computer engineer from Spain, and I’ve been a Godot fan for a few years now
I’ve used the engine in a few personal projects, although this time I am not reaching out to talk specifically about game development ![]()
A few months ago I finished a research-oriented Master’s degree in Systems and Computer Engineering, and taking advantage of Godot’s open-source nature, I decided to focus my final thesis on studying and trying to improve its performance in the godot-benchmarks repository scenes, focusing exclusively on the engine’s compilation options. The technique I used, which has already been featured in several publications within my research group, consists of using metaheuristics to find sequences of LLVM optimization passes that outperform standard optimization flags (O1, O2, O3, etc.).
In my work, I didn’t manage to outperform the official compilation options specified in the Godot documentation. This may be partly due to the fact that our current methodology only applies optimizations at the LLVM middle-end, leaving potential improvements in other stages of the pipeline that the official build configurations do take advantage of. However, when considering only engine versions optimized at this specific stage, I did obtain results showing notable changes between different optimization levels. And more importantly, I observed specific instances where the pass sequences found via metaheuristics actually outperformed the standard flags, hinting at a potential for improvement over these generic optimizations.
I should mention that this technique, while showing promising results, has one main drawback: finding these optimal sequences of optimization passes requires evaluating thousands upon thousands of valid sequences in search of better ones. This involves not only testing the performance of the program itself, but also applying the optimizations and generating the final binary each time before it can even be tested. This is somewhat manageable for simpler programs, but for a project as large as Godot, it translates to several minutes per evaluation, which has also limited the quality of the preliminary results obtained in my work.
One way to make this approach more practical for Godot could be to focus on specific subsystems rather than the entire engine, saving some time that way. In my thesis, optimizations were applied globally, but targeting components such as the GDScript VM might be a more realistic starting point, particularly given previous discussions like this one: https://github.com/godotengine/godot-proposals/issues/6031
On a related note, I also came across a GitHub issue before starting my work that also explores the potential of tweaking Godot’s compilation process, though I’m unsure of its practical applicability: https://github.com/godotengine/godot-proposals/issues/11431
With that said, I have just begun my PhD studies, and I’m considering dedicating my dissertation to diving deeper into this research. I also want to extend the experimentation to energy consumption reduction, which I believe could be especially interesting for maximizing battery life on handheld devices (and helping the environment in general, of course). My Master’s thesis served as a proof of concept to show that the methodology is applicable and promising, but I thought that before fully committing to this path, it would be good to share my ideas with the community rather than working in total isolation. This way, I can hopefully achieve something truly useful for the engine.
I would greatly appreciate any feedback or questions, and I would be more than happy to talk more in-depth about my work and results if you find it interesting! I would especially love to hear whether you think this direction could realistically benefit the engine, and if there are particular areas where such experimentation would make more sense ![]()
TL;DR: I’m a PhD student researching how to use metaheuristics to find better compiler optimization sequences for Godot, aiming to enhance performance and reduce power consumption. While I haven’t outperformed the official builds overall for the moment, I have identified specific cases with measurable improvement potential. I’d love some community feedback to better align this research with the engine’s needs ![]()
Note: If there’s a more technical channel or a specific development group where this discussion would be more appropriate, please let me know!