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

Xlua 1.2.0 (LuaJIT) performance issues #18

Open
JT8D-17 opened this issue Jun 27, 2023 · 1 comment
Open

Xlua 1.2.0 (LuaJIT) performance issues #18

JT8D-17 opened this issue Jun 27, 2023 · 1 comment

Comments

@JT8D-17
Copy link

JT8D-17 commented Jun 27, 2023

Investigating the heavy impact of xlua 1.2.0 on the frametime when using XP 12.05's default Airbus A330, I stumbled upon the use of "jit.off()" in "A333.ecam_fws999.lua".

On my system (Ryzen 5800X, Arch Linux, kernel 6.3), the default A330's xlua, in its "out of the box" configuration takes up ~18 % of the frametime in a test scenario.

Disabling "jit.off()" in the Lua file, i.e. using the JIT compiler instead of the regular Lua interpreter, and restarting XP makes xlua's frametime proportion baloon to >60 %.

Then I compiled xlua 1.2.0 with a library from the LuaJIT repository's 2.0.5 branch.
~~Without "jit.off()", i.e. using the JIT compiler, xlua uses ~18 % of frametime. But I've also had cases where the frametime proportion was >60 %, but dropped back to ~18 % after an aircraft reload.~~
~~With "jit.off()", i.e. using the Lua interpreter, frametime fraction was lower at ~15%.~~

Compiling xlua 1.2.0 with the LuaJIT library from the 2.1 branch (latest commit) exhibited no change in behavior compared to the regular xlua 1.2.0 release.

Since the employment of "jit.off()" also seems to benefit SASL (which apparently also uses LuaJIT 2.1.0) and other xlua 1.2.0 applications (Zibo's 737), I think the frametime performance issue may be a general LuaJIT 2.1.0 bug.

As my C skill is too low to debug LuaJIT, I am posting this here for awareness and information, hoping that somebody else is able to dive deeper and potentially take this issue to the LuaJIT developers.

- Edit:
The effects of the recompiled Xlua plugin using 2.0.5 may have been due to scripts that refuse to parse and which are thus not being executed. So please disregard that finding.

@JT8D-17
Copy link
Author

JT8D-17 commented Dec 4, 2023

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

No branches or pull requests

1 participant