Later or more recent Lua interpreters are supposed to have an incremental garbage collector. The GC calling thread-safe memory management functions to do an incremental collection step may have impact on core performance, possibly including jitter. Can't think of anything else in Lua that is a performance drag on everything.
In the past, when Lua had a mark-and-sweep GC, among the more extreme measures to avoid GC delays in games with Lua scripting is to avoid object creation entirely in a game loop. Set up the objects, then run the game loop. This way, the GC won't be triggered (at least, that is roughly what I read -- I am not a game programmer).
If you can run a Lua test script without creating objects (no table creation etc) with the PCM sound output, it may have an effect on the jitter you are experiencing. If a reduction of jitter is observed, then the cause is thread safe memory management / GC of the scripting language, be it Lua or MicroPython. It is often the thing that comes out of the woodwork to bite you (at least, on a PC) when you desire max performance from an interpreted bytecode language.
[Edit] GC compacting involves moving objects, so that's gotta hurt performance...![Shocked :shock:]()
In the past, when Lua had a mark-and-sweep GC, among the more extreme measures to avoid GC delays in games with Lua scripting is to avoid object creation entirely in a game loop. Set up the objects, then run the game loop. This way, the GC won't be triggered (at least, that is roughly what I read -- I am not a game programmer).
If you can run a Lua test script without creating objects (no table creation etc) with the PCM sound output, it may have an effect on the jitter you are experiencing. If a reduction of jitter is observed, then the cause is thread safe memory management / GC of the scripting language, be it Lua or MicroPython. It is often the thing that comes out of the woodwork to bite you (at least, on a PC) when you desire max performance from an interpreted bytecode language.
[Edit] GC compacting involves moving objects, so that's gotta hurt performance...

Statistics: Posted by katak255 — Thu Oct 24, 2024 1:45 am