- Home /
how much CPU do codes inside the update function use?
I need some basic but exact information about how calculations are done in unity. I know it depends on the process for example using SendMessage
every frame can be a horrible resource hog. but what about setting a value? I think unity itself runs hundreds or maybe thousands of lines of code to render a frame. so does it really hurt to have a code in update function? or we should avoid it as much as we can? I need to know about different calculations so consider this list:
SendMessage, Find, Mathf functions, Setting variables, Writing data on disk, and so on...
A detailed answer would be a great help for many newbies here. thanks!
Nobody can answer that; it depends on what you're doing. But doing something is always slower than not doing something, by definition. If you don't need something calculated every frame, then don't use Update.
Answer by Ebil · May 08, 2013 at 11:26 PM
Have no information but, how about you try it? I for myself will not think about that until i come to some trouble that could be caused by that. Just to a million Sends or finds per Update and you will see the different fps.
Well thanks, and I do try it myself too, but I asked to know what experts say here...