Code Optimization Phase

WARNING
''This page contains outdated (mis)information. For an up-to-date description of the program launch process, please refer to the ACOS Program page. Contents of this page will be kept for historical reasons.''

The Code Optimization Phase (COP) is the action performed by AndyCraft when an non-compiled Lua script is being initialized.

Location
This is the location of COP in the script initialization process: -Launch -Coroutine creation -Sandbox creation -Antivirus check -API check -Code Optimization Phase (-File handle deletion) -Initialization (raw error check/lexer check) only if the code is loaded from a file: (-File handle creation -File exists check )

Technology
The main inner workings of COP are inherited from the LuaSrcDiet project, mainly implementing the -minify option along with other optimizations such as removing comments from the code. However, implementation of the whole source of LuaSrcDiet would consume up to 170KB of memory making the process ineffective.

Other sources
Along with the LuaSrcDiet, the ideas for code optimization are taken from wiki/OptimisationTips and mainly from wiki/OptimisationCodingTips (where

local wiki="lua-users.org/wiki"

)