lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


If your issue with globals is performance then the question is how
frequently a running program will reference them.

If  program has a two or three globals that are referenced all over
the place then you will see some performance hit. Especially if they
are embedded in some tight loops.

If you have a program with 100 globals but they are only referenced
only once per run then the impact on performance is likely to be
minimal.

So a metric such as "less than X globals is ok, more than X is bad" is
not going to get you anywhere.

The issue is how often you access them. For that you need to measure things.