Improve the performance of the GDScript VM through offline compilation
### Describe the project you are working on Godot ### Describe the problem or limitation you are having in your project Many users have complained for a long time about the performance in GDScript. For the GDScript 2.0 rewrite, a lot of work was put into making sure the VM has all the information required to generate optimized code, including type information, strict type checking, better addressing modes and the ability to access every operator, utility function, etc. as a C function pointer. This can be evidenced by the new [codegen class](https://github.com/godotengine/godot/blob/master/modules/gdscript/gdscript_codegen.h) used to emit code. Unfortunately, just the changes to the parser and compiler ended up being very significant so almost no optimization work could take place for the VM. ### Describe the feature / enhancement and how it helps to overcome the problem or limitation The idea is to use the the new type information as well as all the C function pointers to engine to generate direct executable code and bypass the VM, allowing for much greater performance when typed code is used. This is challenging to do in a practical way, however. Because of it, this is more of an open discussion on evaluating different alternatives. ### Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams There are a few general approaches that could be taken to optimize GDScript: * JIT * real-time AOT * offline compilation. The problem with J
Posted by reduz on Jan 1, 2023, 8:45 AM
Tags
Related issues
- [Meta] Feedback on granular control over Copilot changes
- unexpected status 401 Unauthorized issue
- [MODEL] Measurable quality regression in Claude generation 5 (Fable 5 / Opus 5 / Sonnet 5): worse nonsense detection, ~2x verbosity, under-disclosed model fallb
- [CRITICAL] Subagent spawning and subagent pattern bugs trigger infinite recursion, infinite token usage, grossly inefficient token usage, and lost accumulated s
- Video stops playing after some minutes
- [MODEL] Claude verbose code comments by default — ignores instructions to stop.
Raise real-world problems, find people facing the same issue, and discuss solutions.2,500 issues0 comments
github (Software)
[Meta] Feedback on granular control over Copilot changes
unexpected status 401 Unauthorized issue
[MODEL] Measurable quality regression in Claude generation 5 (Fable 5 / Opus 5 / Sonnet 5): worse nonsense detection, ~2x verbosity, under-disclosed model fallb
[CRITICAL] Subagent spawning and subagent pattern bugs trigger infinite recursion, infinite token usage, grossly inefficient token usage, and lost accumulated s
Video stops playing after some minutes
[MODEL] Claude verbose code comments by default — ignores instructions to stop.
Scope Codex VS Code chats to the current workspace/project
Update on "Co-authored-by: Copilot" in commit messages
Improve the performance of the GDScript VM through offline compilation
### Describe the project you are working on Godot ### Describe the problem or limitation you are having in your project Many users have complained for a long time about the performance in GDScript. For the GDScript 2.0 rewrite, a lot of work was put into making sure the VM has all the information required to generate optimized code, including type information, strict type checking, better addressing modes and the ability to access every operator, utility function, etc. as a C function pointer. This can be evidenced by the new [codegen class](https://github.com/godotengine/godot/blob/master/modules/gdscript/gdscript_codegen.h) used to emit code. Unfortunately, just the changes to the parser and compiler ended up being very significant so almost no optimization work could take place for the VM. ### Describe the feature / enhancement and how it helps to overcome the problem or limitation The idea is to use the the new type information as well as all the C function pointers to engine to generate direct executable code and bypass the VM, allowing for much greater performance when typed code is used. This is challenging to do in a practical way, however. Because of it, this is more of an open discussion on evaluating different alternatives. ### Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams There are a few general approaches that could be taken to optimize GDScript: * JIT * real-time AOT * offline compilation. The problem with J
Comments (0)
No comments yet. Start the discussion.