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

Add a way to disable native codegen #257

Open
CompeyDev opened this issue Sep 16, 2024 · 0 comments · May be fixed by #265
Open

Add a way to disable native codegen #257

CompeyDev opened this issue Sep 16, 2024 · 0 comments · May be fixed by #265
Labels
enhancement New feature or request pending / needs design Awaiting design and/or implementation discussion and decisions

Comments

@CompeyDev
Copy link
Contributor

Lune exposes no way to disable Luau's JIT, which is enabled by default for all cases, except for hardware where which Luau does not support codegen for. In general, it makes sense to provide the most optimized configuration possible as a runtime by default.

lua.enable_jit(options.codegen_enabled && !env_changed);
let function = chunk.into_function()?;
lua.enable_jit(true);

Although rare, it is sometimes possible for JIT to be slower in some cases, or the user might want more fine-grained control over what aspects JIT is applied to (preferably using the @native attribute). For such use-cases, it makes sense to expose an environment variable and/or flag which can toggle JIT in the runtime.

Other runtimes like Bun for JavaScript already expose such options in a similar way.

@filiptibell filiptibell added enhancement New feature or request pending / needs design Awaiting design and/or implementation discussion and decisions labels Sep 16, 2024
@CompeyDev CompeyDev linked a pull request Oct 17, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pending / needs design Awaiting design and/or implementation discussion and decisions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants