In 2.3, the current retail version, scripts are interpreted on the fly as they are executed. The interpretation is expensive for two reasons.

1. The game has to process the commands as text (strings), by parsing them, comparing and converting the strings into commands and data, letter by letter, number by number, and testing for errors. This takes considerable CPU time to do.

2. In C#, particularly on the Xbox 360, string manipulation is expensive because it creates a lot of garbage, which is memory allocations, and after a certain amount of memory is allocated, the C# runtime performs a garbage collection, which in TM is extremely expensive, causing lock ups than sometime last for several hundred milliseconds (several frames). This is noticeable as annoying little freezes during gameplay. This problem is compounded by looping scripts.

In 2.31, scripts are no longer interpreted on the fly, they are now compiled (once) into bytecode, and it is the byte code that is executed when the script is executed. This means all the string manipulation, parsing, error checking is done only once, up front, during the compilation, and doesn't have to be done again (unless the scripted is edited/changed).

This is much more efficient because now the game can just execute the commands directly. It also drastically reduces the amount of generated garbage. This is particularly beneficial for looping scripts.

Some garbage is still generated by some commands, commands that utilize text substitution for example as the substitution cannot be done at compile time, but in general, garbage generation by scripts in 2.31 is only a fraction of what it is in 2.3.

Another benefit of much more efficient script execution is that it is now much less problematic to attach scripts to events, particularly events that can happen rapidly/frequently, such as breaking blocks, striking objects, taking damage, etc. This was a big part of the motivation to move to the byte code method, so that we can now look into event driven scripts with confidence.