Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tip to improve GDscript performance #5217

Closed
be-thomas opened this issue Aug 20, 2022 · 6 comments
Closed

Tip to improve GDscript performance #5217

be-thomas opened this issue Aug 20, 2022 · 6 comments

Comments

@be-thomas
Copy link

Describe the project you are working on

I was looking at the GDscript code It seems like an interpreted language.

Describe the problem or limitation you are having in your project

As evident, Interpreted languages are slow

Describe the feature / enhancement and how it helps to overcome the problem or limitation

We could translate GDScript bytecode to luajit for massive performance improvements.
As we all know luajit is the fastest scripting language it will be pretty much equivalent to C# or may even surpass it when types are specified through ffi.
I know some platforms do not support JIT, but even when the JIT is off (only for platforms which don't support it), it still destroys pretty much any other scripting language in terms of performance.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

I suggest a transpiler which works on bytecode level (simpler to implement) or a source to source compiler

If this enhancement will not be used often, can it be worked around with a few lines of script?

Either we should implement this as an experimental feature or improve the gdscript performance.

Is there a reason why this should be core and not an add-on in the asset library?

Performance should be built-in from the core of the engine. So this is a must.

@Zireael07
Copy link

GDScript is tailored to Godot itself.

There's a whole page in the docs explaining why a custom language instead of Python or Lua. Speaking of, there is Lua for Godot plugin, too

@Calinou
Copy link
Member

Calinou commented Aug 20, 2022

Duplicate of #3069. There are no plans to implement a JIT compiler, as JIT is not allowed on iOS (and having performance suddenly decrease after exporting to a specific platform isn't a good experience).

@Calinou Calinou closed this as not planned Won't fix, can't repro, duplicate, stale Aug 20, 2022
@be-thomas
Copy link
Author

be-thomas commented Aug 20, 2022

I'm not suggesting to support lua as programming language.
I'm suggesting to translate gdscript behind the scenes to lua, so that the performance improvements are automatically visible.
This is incase, writing a JIT is too much to do (which it is anyways)

@be-thomas
Copy link
Author

This is so strange, without even understanding & taking up suggestions, the open source project maintainers close the issue.

@YuriSizov
Copy link
Contributor

This is so strange, without even understanding & taking up suggestions, the open source project maintainers close the issue.

It was closed as a duplicate. You can add to the existing discussion instead of starting a new one.

That said, general suggestions about performance are not useful. Specific use cases should be presented and investigated. The engine does the heavy-lifting, not the scripting language, so optimizations must be discussed with specifics, not in broad terms.

@Zireael07
Copy link

@be-thomas Transpile to LuaJIT isn't likely to be accepted either because of what Calinou said (iOS won't accept LuaJIT either)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants