TheXerxes Posted November 5, 2023 Posted November 5, 2023 DCS is still utilizing Lua 5.1, which is both unsupported and obsolete. Alternatives such as LuaJIT and Luau offer drop-in replacement compatibility with the Lua 5.1 API and present significant advantages. LuaJIT, in particular, stands out due to its remarkable performance, which you can evaluate in the provided benchmark at this link: https://eklausmeier.wordpress.com/2020/05/14/performance-comparison-pallene-vs-lua-5-1-5-2-5-3-5-4-vs-c/ . LuaJIT is about 19 times faster than Lua 5.1 in the provided benchmark. LuaJIT elevates performance by compiling Lua code directly into machine code during runtime, bypassing the virtual machine (VM) approach inherent to Lua 5.1. This can lead to execution speeds on par with C and C++ in certain scenarios. Additionally, LuaJIT enhances Foreign Function Interface (FFI) calls, which could notably optimize the interactions between C++ and Lua within your project. Given these points, I strongly suggest transitioning to LuaJIT or Luau to modernize and boost DCS's runtime efficiency. This change is likely to yield a significant improvement in both frame rates and server mission performance without breaking compatibility with the available Lua code base. Best Regards, Xerxes of Shadow Reapers 10
-Cipher- Posted November 5, 2023 Posted November 5, 2023 I just checked the benchmark and that was a significant boost, I am not a skilled coder nor a developer but based on my observation on this if DCS codes could be upgraded without major compatibility problems I believe it could take it to the next level so yeah a +1 from me. 3 CPU :Intel® Core i5-13600KF | GPU :ASUS RTX 4070 Super OC |RAM : Corsair Vengeance DDR5 32 GB | SSD 500GB & 1TB Samsung | Flight gear : T.16000 FCS Flight Pack | MB : ASUS Z790P Wish-list : F-117 Nighthawk | F-14D Super Tomcat | F-111 Aardvark | P-38M Lightning
Raven (Elysian Angel) Posted November 5, 2023 Posted November 5, 2023 Perhaps it's a good idea to send it as a PM to Bignewy or NineLine (or SkateZilla), and ask what they think about it? 2 Spoiler Ryzen 9 5900X | 64GB G.Skill TridentZ 3600 | Asus ProArt RTX 4080 Super | ASUS ROG Strix X570-E GAMING | Samsung 990Pro 2TB + 960Pro 1TB NMVe | VR: Varjo Aero Pro Flight Trainer Puma | VIRPIL MT-50CM2 grip on VPForce Rhino with Z-curve extension | Virpil CM3 throttle | Virpil CP2 + 3 | FSSB R3L | VPC Rotor TCS Plus base with SharKa-50 grip | Everything mounted on Monstertech MFC-1 | TPR rudder pedals OpenXR | PD 1.0 | 100% render resolution | DCS graphics settings
cfrag Posted November 5, 2023 Posted November 5, 2023 16 minutes ago, Insonia said: Most DCS lua just tables. And Mission Editor. Indeed it does not seem as if there is a great appetite in ED to change the mission scripting environment, since it apparently runs good enough, and there is very little obvious return on investment for funds invested in upgrading Lua (interpreted) to Lua (JIT) - which I imagine to be very different from a drop-in replacement (read: expensive in terms of effort). Hopefully I'm wrong, as compiled Lua - even if JIT - sounds like a nice performance boost. 1
SkateZilla Posted November 5, 2023 Posted November 5, 2023 5 hours ago, Raven (Elysian Angel) said: Perhaps it's a good idea to send it as a PM to Bignewy or NineLine (or SkateZilla), and ask what they think about it? My thoughts and opinions are of my own, and have no affiliation w/ ED or their Business decisions. But I did give it a re-post. 3 1 Windows 10 Pro, Ryzen 2700X @ 4.6Ghz, 32GB DDR4-3200 GSkill (F4-3200C16D-16GTZR x2), ASRock X470 Taichi Ultimate, XFX RX6800XT Merc 310 (RX-68XTALFD9) 3x ASUS VS248HP + Oculus HMD, Thrustmaster Warthog HOTAS + MFDs
Raven (Elysian Angel) Posted November 5, 2023 Posted November 5, 2023 1 hour ago, SkateZilla said: My thoughts and opinions are of my own Yes, exactly! You have the know-how and you're an independent voice who has contacts with ED. That's all I meant with my suggestion 1 Spoiler Ryzen 9 5900X | 64GB G.Skill TridentZ 3600 | Asus ProArt RTX 4080 Super | ASUS ROG Strix X570-E GAMING | Samsung 990Pro 2TB + 960Pro 1TB NMVe | VR: Varjo Aero Pro Flight Trainer Puma | VIRPIL MT-50CM2 grip on VPForce Rhino with Z-curve extension | Virpil CM3 throttle | Virpil CP2 + 3 | FSSB R3L | VPC Rotor TCS Plus base with SharKa-50 grip | Everything mounted on Monstertech MFC-1 | TPR rudder pedals OpenXR | PD 1.0 | 100% render resolution | DCS graphics settings
TheXerxes Posted November 6, 2023 Author Posted November 6, 2023 To clarify, the original Lua project (found at lua.org) and LuaJIT (available at luajit.org) are distinct projects. LuaJIT enhances Lua 5.1 compatibility by offering substantial performance improvements, both with and without its Just-In-Time compilation features, compared to the standard Lua 5.1 implementation. Assuming that a system like DCS relies heavily on Lua's table structures, which are dependent on Lua's hashing functions and internal mechanisms, a switch to LuaJIT would lead to more efficient table access. This is because LuaJIT not only compiles the code for reading tables, resulting in smoother linear execution but also employs a more efficient and better-distributed hashing algorithm (https://en.wikipedia.org/wiki/Hash_function). Regardless of whether DCS utilizes Lua solely for its hash tables, which it doesn't, LuaJIT has the capacity to speed up both the lexing/parsing phase—which translates the program's text into a form the computer can process—and the performance of table operations. It is important to mention LuaJIT's performance in calling C and C++ functions is better than Lua 5.1 too, so switching to it will boost communication with DLLs and compiled part of DCS. The best thing is that LuaJIT is C API compatible with Lua 5.1 C API, so it is possible to use it as a drop-in replacement in DCS with some small changes. The other positive point is that LuaJIT is well battle-tested, companies and organizations like Cern, Cloudflare, and Cisco are notable users of it. I would love to hear from the DCS development team. 3
ED Team BIGNEWY Posted November 6, 2023 ED Team Posted November 6, 2023 Hi all, we do have an internal report to investigate the potential of LuaJIT. I have marked this thread investigating for now thank you 9 2 Forum rules - DCS Crashing? Try this first - Cleanup and Repair - Discord BIGNEWY#8703 - Youtube - Patch Status Windows 11, NVIDIA MSI RTX 3090, Intel® i9-10900K 3.70GHz, 5.30GHz Turbo, Corsair Hydro Series H150i Pro, 64GB DDR @3200, ASUS ROG Strix Z490-F Gaming, PIMAX Crystal
ED Team BIGNEWY Posted June 12, 2024 ED Team Posted June 12, 2024 Hi all, we have tried LuaJIT but DCS does not work with LuaJIT out of the box and requires heavy debugging and an unknown number of fixes, It also messes with the function of some 3rd party modules. At this stage it would be a lot of work to change, so for now it is not planned. thank you 1 4 Forum rules - DCS Crashing? Try this first - Cleanup and Repair - Discord BIGNEWY#8703 - Youtube - Patch Status Windows 11, NVIDIA MSI RTX 3090, Intel® i9-10900K 3.70GHz, 5.30GHz Turbo, Corsair Hydro Series H150i Pro, 64GB DDR @3200, ASUS ROG Strix Z490-F Gaming, PIMAX Crystal
Raven (Elysian Angel) Posted June 12, 2024 Posted June 12, 2024 That's a shame... Thanks for checking anyway 2 1 Spoiler Ryzen 9 5900X | 64GB G.Skill TridentZ 3600 | Asus ProArt RTX 4080 Super | ASUS ROG Strix X570-E GAMING | Samsung 990Pro 2TB + 960Pro 1TB NMVe | VR: Varjo Aero Pro Flight Trainer Puma | VIRPIL MT-50CM2 grip on VPForce Rhino with Z-curve extension | Virpil CM3 throttle | Virpil CP2 + 3 | FSSB R3L | VPC Rotor TCS Plus base with SharKa-50 grip | Everything mounted on Monstertech MFC-1 | TPR rudder pedals OpenXR | PD 1.0 | 100% render resolution | DCS graphics settings
Kappa-131st Posted June 18, 2024 Posted June 18, 2024 On 6/12/2024 at 10:14 AM, BIGNEWY said: Hi all, we have tried LuaJIT but DCS does not work with LuaJIT out of the box and requires heavy debugging and an unknown number of fixes, It also messes with the function of some 3rd party modules. At this stage it would be a lot of work to change, so for now it is not planned. thank you Thanks for checking! 1 1
cfrag Posted June 19, 2024 Posted June 19, 2024 On 6/12/2024 at 10:14 AM, BIGNEWY said: we have tried LuaJIT but DCS does not work with LuaJIT This is sad news - but thank you so much for updating us. It's good to know that this milestone was reached, even if it did not yield the results that we have hoped for. 1 1
Recommended Posts