Lua In Real Time Programs

lua-users home
wiki

Showing revision 15
VersionNotice: This article relates to an earlier version of Lua. Incremental garbage collection is available as of Lua 5.1.

Older versions of Lua (prior to 5.1) are not well-suited for (the main loops of) real-time programs. The reason isn't that Lua is slow--in fact it probably has the fastest virtual machine of any scripting language. The problem is the mark-and-sweep garbage collection, which requires a concentrated chunk of CPU time proportional to the number of objects allocated. It was useful in 5.1 to replace the mark-and-sweep collector with a real-time incremental system (see paper Real-Time Non-Copying Garbage Collection [1]). In older version of Lua, there are still several ways to make good use of Lua in real-time programs:


See also: OptimisationTips , GarbageCollection , ProfilingLuaCode , GarbageCollectionInRealTimeGames
RecentChanges · preferences
edit · history · current revision
Edited May 16, 2008 1:47 am GMT (diff)