Playmaker Forum

PlayMaker Help & Tips => Android Help => Topic started by: ergin on May 27, 2016, 07:55:27 AM

Title: Profiler - GUI.Repaint consume %33 of CPU - Is this Normal?
Post by: ergin on May 27, 2016, 07:55:27 AM
Hello for the game I am developing right now GUI.Repaint consume %33 of CPU, Is this Normal?

(http://www.ergin3d.com/mike/profiler1.jpg)

game's youtube video
https://www.youtube.com/watch?v=mnXeekL9mcA (https://www.youtube.com/watch?v=mnXeekL9mcA)

Thanks.
Title: Re: Profiler - GUI.Repaint consume %33 of CPU - Is this Normal?
Post by: ergin on May 27, 2016, 09:58:32 AM
I turned off Admob, it had no effect, I turned on deep profile:
(http://ergin3d.com/mike/profiler2.jpg)
Title: Re: Profiler - GUI.Repaint consume %33 of CPU - Is this Normal?
Post by: ergin on May 27, 2016, 10:25:44 AM
:) After deep profile, to test if its the State Labels, I turned off "Show State Labels in Game" from Preferences / Debugging. This time game really slowed down:

Even If I turned it back-on or restarted the Unity frame rate dropped to 15fps

Unity 5.3.2f1- Playmaker 1.8.1

(http://ergin3d.com/mike/profiler3.jpg)
Title: Re: Profiler - GUI.Repaint consume %33 of CPU - Is this Normal?
Post by: ergin on May 27, 2016, 10:54:40 AM
Sorry, I guess my bad... I turned off Enable Logging it turned to normal.
Title: Re: Profiler - GUI.Repaint consume %33 of CPU - Is this Normal?
Post by: Alex Chouls on May 27, 2016, 10:56:58 AM
It's important to look at the ms, not just the percentage. In your first screenshot you're talking about less than 1ms. Unity's OnGUI actions are not super efficient, but often good enough. Were you seeing frame rate issues?

In the last screenshot it looks like something is spamming the debug console, causing the massive slowdown. What's in your console?

EDIT: Saw your note about logging. I would still try to track down what's spamming the console. You shouldn't have to turn off logging.

EDIT: Also are you using GUI actions?
Title: Re: Profiler - GUI.Repaint consume %33 of CPU - Is this Normal?
Post by: ergin on May 27, 2016, 11:40:33 AM
Thanks Alex,

I guess I unintentionaly clicked "Forward Playmaker Log to Unity Log" It's the playmakers log. :)

I am constantly looking for ways to decrease cpu consumption, and regularly checking profiler as it is a mobile game, actually I am not super-satisfied with my frame-rates. I am trying to keep min. req. to Dual-core 1.2 GHz and Vivante GC1000 which sometimes drops below 30.

I am not using any GUI actions.

Thanks.
Title: Re: Profiler - GUI.Repaint consume %33 of CPU - Is this Normal?
Post by: Alex Chouls on May 27, 2016, 11:46:52 AM
If you're not using GUI actions you can remove the PlayMakerGUI GameObject from the scene when you make a build (you might want to keep it around to debug in the editor). Also un-check "Automatically Add PlayMakerGUI" in Preferences.

When you checked "Forward Playmaker Log to Unity Log" was it just state transitions spamming the console, or any particular action?
Title: Re: Profiler - GUI.Repaint consume %33 of CPU - Is this Normal?
Post by: ergin on May 27, 2016, 12:17:52 PM
It's just the state transitions. I'm using "wait" 0.1 and make distance and bool comparisons to spawn or reposition game objects which is technically a loop and that floods the playmaker transitions in the log.

Thanks.
Title: Re: Profiler - GUI.Repaint consume %33 of CPU - Is this Normal?
Post by: coxy17 on January 24, 2017, 03:16:23 AM
Hi Ergin

I think i have the same issue you had but not sure, do you have any tips you could share with me as im new to using the profiler and should of really started using it when i first started my game. So much to learn.

Title: Re: Profiler - GUI.Repaint consume %33 of CPU - Is this Normal?
Post by: Fat Pug Studio on October 11, 2020, 02:14:15 PM
This is currently the bane of my existance with no solution in sight.
Title: Re: Profiler - GUI.Repaint consume %33 of CPU - Is this Normal?
Post by: Broken Stylus on November 20, 2020, 02:04:00 PM
Hi Ergin

I think i have the same issue you had but not sure, do you have any tips you could share with me as im new to using the profiler and should of really started using it when i first started my game. So much to learn.

96 ms, that's a lot but is it caused by the editor? in this case, have you tried to run on full screen?
Or are you profiling on a connected device (development for a mobile app)?
Title: Re: Profiler - GUI.Repaint consume %33 of CPU - Is this Normal?
Post by: Alex Chouls on December 08, 2020, 02:38:07 PM
This is currently the bane of my existance with no solution in sight.

I thought the issue had been tracked to logging (which is very slow in the Unity editor). Is there another issue? Sorry, there are a few different issues discussed in the thread, and want to make sure I'm investigating the right thing!