Jump to content

Script commands listed by CPU cost?


TheMastersSon

Recommended Posts

Just out of curiosity, has anyone ever figured out which functions in the CS cost the least and most in cpu time?

 

E.g. a script is supposed to run only at a certain hour, and only when PlayerRef is in a specific cell. So is it logical to assume the cell check should be performed first, since it's a boolean function, instead of a fixed value like GameHour. Etc.

Link to comment
Share on other sites

Attach the script to an object in the cell. The script will only run when the object is loaded in memory (so, when the player is in the cell and for a while after leaving it).

 

About cost, there's no benchmark, but you can assume all commands run (individually) reasonably fast, except for GetLOS called with an not-actor parameter or GetFPS.

 

Performance problems rise when the script need to run continuously, doing a ForEach/While/GetFirstRef with an expensive algorithm (look at HUD Status Bars if you want to see a very expensive algorithm/script).

Edited by forli
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...