playMaker

Author Topic: potential performance of getting values every frame?  (Read 2916 times)

derkoi

  • Full Member
  • ***
  • Posts: 187
potential performance of getting values every frame?
« on: January 24, 2013, 04:33:06 AM »
I'm currently trying to gain more performance from my mobile game. I have data in scripts for times and speed and other things & I use the get float action, every frame, convert it to a string every frame and then set the text value of an NGUI label, every frame.

Now, since I don't know much about optimisation but have read a little, my 'spider sense' is tingling with the every frame stuff, there's quite a few of them for various times and speed, i'd say about 8 or more.

I can't help but think that I should perhaps use the Float Changed action, then calculate and display the data, then wait for the float to change again. This however sounds pointless for values that are constantly changing like time & speed.

What's your thoughts please.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: potential performance of getting values every frame?
« Reply #1 on: January 24, 2013, 08:18:56 AM »
Hi,

  In order to do efficient performance improvement, you need to first find the bottlenecks, and you will likely find it's not scripts ( be it with our without playmaker)

Have you run the profiler? If you don't have a trial or the full version, I recommend you find someone that has it and run your game in there.

 8 variables is not a lot, and I don't think it is an issue to convert to string even in the game loop.


bye,

 Jean

derkoi

  • Full Member
  • ***
  • Posts: 187
Re: potential performance of getting values every frame?
« Reply #2 on: January 24, 2013, 08:27:02 AM »
Thanks for the reply Jean, I have run the profiler & I spent all day yesterday trying out different things like disabling mesh colliders & removing models completely, all which made very little difference to the frame rate.

The only things I didn't go through was my playmaker scripts which made me wonder if I'm being efficient with them.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: potential performance of getting values every frame?
« Reply #3 on: January 24, 2013, 08:28:19 AM »
Hi,

 the profiler will show you what is the bottle neck, that's the point. so in your frame, what takes up the most time?

bye,

 Jean

derkoi

  • Full Member
  • ***
  • Posts: 187