1. Trouble with the game?
    Try the troubleshooter!

    Dismiss Notice
  2. Issues with the game?
    Check the Known Issues list before reporting!

    Dismiss Notice

BeamNG Lua performance comparison

Discussion in 'General Discussion' started by PriusRepellent, Feb 17, 2019.

  1. PriusRepellent

    PriusRepellent
    Expand Collapse

    Joined:
    Mar 19, 2018
    Messages:
    353
    Wasn't sure where to put this, but I thought it'd be interesting to share this. I decided to see how different Lua implementations stack up against each other, so I made this simple loop. It counts how many times the loop can be run in 1 second.
    Code:
    i=0 now=os.clock() while os.clock() < now + 1 do i = i + 1 end print(i)
    Results:
    TPT (The Powder Toy): 10,923,792
    GMod (Chromium branch): 11,922,030
    HexChat (IRC client, x64, Windows): 20,557,857
    Browser Lua implementation (ran in latest Google Chrome): 252,807
    BeamNG: 18,107,407

    What this tells me is that Beam's Lua implementation has some pretty good optimization done to it.
    EDIT: Updated the GMod score due to finding it was not being executed in the same manner as the others, which deflated its score. It is more accurate now. It still does not change the fact that BeamNG's lua is executing at a good speed.
     
    #1 PriusRepellent, Feb 17, 2019
    Last edited: Feb 17, 2019
    • Like Like x 6
    • Informative Informative x 1
  2. tdev

    tdev
    Expand Collapse
    Developer
    BeamNG Team

    Joined:
    Aug 3, 2012
    Messages:
    3,031
    • Informative Informative x 2
    • Like Like x 1
  3. PriusRepellent

    PriusRepellent
    Expand Collapse

    Joined:
    Mar 19, 2018
    Messages:
    353
    Yeah I figured that had to be the case. There's no way it'd be running that fast otherwise. HexChat uses it too and performance is very similar. The interesting part though is how GMod runs a bit slower despite using LuaJIT. It is x86 and not x64 though,and I've seen cases where Lua runs slower on x86 than x64.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice