Torque script:the performance of dynamic field assignment?

There are no stupid questions, just stupid answers.
2 posts Page 1 of 1
Posts: 6
Joined: Fri May 06, 2016 5:41 am
by maxzhou0 » Fri Feb 17, 2017 9:45 am
i think mass df assignment is very harmful in a game loop, but i don't have direct evidence to proof it.
when i use "for(%i = 0;%i<%largeNumber;%i++){}" to test TS, the static field didn't show much difference from dynamic field, wth
Steering Committee
Steering Committee
Posts: 858
Joined: Tue Feb 03, 2015 9:49 pm
by JeffR » Mon Feb 20, 2017 7:14 am
There's really not going to be all that much difference in performance when assigning through script. In both cases, setting the variable passes through the console backend, and calls the setDynamicField or setStaticField, which looks at the appropriate field library, iterates through all the fields for that object in the respective type to see if it finds it, and then sets it as appropriate.

There'd be a nearly-infinitesimal improvement for static fields because they're checked through before dynamic fields, but the general path and workload is roughly the same, so unless you're doing some really aggressive setting of vars like crazy, you probably won't really see much difference in practice.
2 posts Page 1 of 1

Who is online

Users browsing this forum: No registered users and 5 guests