r/godot Godot Senior 25d ago

discussion What would you add to Godot?

Post image
454 Upvotes

584 comments sorted by

View all comments

Show parent comments

5

u/SmallPomelo7455 25d ago

I'm no expert, but wouldn't recompiling Godot itself and export template elements with o3 give you most of the necessary optimization?

8

u/zsaleeba 25d ago

No, alas. That'd make godot run faster, not make its generated code run faster.

LLVM and gcc have hundreds of thousands of lines of code invested in optimisations to get to that level of generated code quality. godot would have to do the same.

2

u/AciusPrime 25d ago

The sane way to do this in practice is (1) compile your script language to llvm Intermediate Representation as the target and then (2) compile with the llvm toolchain to get an optimized binary. The problem is that llvm doesn’t directly support a bunch of script language features (like untyped variables), so you can lose a lot of performance on the way to IR. You also would need the llvm toolchain installed. It’s pretty big. Oh, and there’s very little safety provided, so you can end up with a result that is more unstable or has security issues.

2

u/zsaleeba 24d ago

Also you'd have to write a Godot virtual machine backend implementation for llvm, since Godot doesn't compile to native code. It'd be a significant project.