On Thu, Jun 11, 2009 at 12:57 PM, David Given
<dg@cowlark.com> wrote:
Robert Raschke wrote:
[...]
I find using a "machine state" Lua table that you can pass around to be pretty ideal.
This means looking stuff up dynamically from the table, which gives you an order of magnitude performance hit. Table lookups are *slow*. Simply moving the program counter from one bytecode address to another is fast. Plus using table lookups means that (assuming I've understood you correctly), the handler for each state needs to be a function, which means you run into the problem of efficiently sharing data between the handlers.