Ran some more tests. I modified the old scripts to cache the GetModule() and GetWaypointByTag() calls on variables, so that the functions were only called once, in an effort to pinpoint exact costs. Here are the scripts for this run:
test_gobt (unchanged)
void main()
{
object oDiseaseControl;
int nX;
for (nX = 0; nX < 1000; nX++)
oDiseaseControl = GetObjectByTag("disease_vuln");
}
test_gnobt
void main()
{
object oDiseaseControl, oWay = GetWaypointByTag("effectsareawaypo");
int nX;
for (nX = 0; nX < 1000; nX++)
oDiseaseControl = GetNearestObjectByTag("disease_vuln", oWay);
}
test_glo
void main()
{
object oDiseaseControl, oMod = GetModule();
int nX;
for (nX = 0; nX < 1000; nX++)
oDiseaseControl = GetLocalObject(oMod,"disease_vuln");//set on modload
}
Run results:
test_gnobt 314 runs 3333 total time
test_gobt 314 644
test_glo 314 1216
Clearly overhead from functions had little to do with it. GNObT is only about 5 times as slow, as opposed to 9, when you don't have to get the waypoint - not that such a situation comes up in practice. GLO is still about twice as slow, meaning that GetModule() is very fast, as expected. I didn't clock GWbT against GObT, but plan to.
Funky