• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by JiminiCanett · Oct 24, 2011 at 05:21 PM · iphoneprofiler

Help on iPhone spikes

Hi, I'm actually doing performance measurements on my game for the iPhone. When I look at the unity/xcode internal profiler logs, I'm seeing strange things. First I saw stuff like having a min of like 6ms for a frame and a max of 52ms (or even more sometime). So changed the number of frames in a profile log from 30 to 1. Here is what i get :


iPhone Unity internal profiler stats: cpu-player> min: 27.7 max: 27.7 avg: 27.7 cpu-ogles-drv> min: 0.4 max: 0.4 avg: 0.4 frametime> min: 31.5 max: 31.5 avg: 31.5 draw-call #> min: 4 max: 4 avg: 4 | batched: 20 tris #> min: 44 max: 44 avg: 44 | batched: 112 verts #> min: 88 max: 88 avg: 88 | batched: 80 player-detail> physx: 2.3 animation: 0.0 culling 0.0 skinning: 0.0 batching: 0.1 render: 2.2 fixed-update-count: 1 .. 1 mono-scripts> update: 22.6 fixedUpdate: 0.0 coroutines: 0.0 mono-memory> used heap: 339968 allocated heap: 479232 max number of collections: 0 collection total duration: 0.0


iPhone Unity internal profiler stats: cpu-player> min: 6.4 max: 6.4 avg: 6.4 cpu-ogles-drv> min: 0.3 max: 0.3 avg: 0.3 frametime> min: 32.6 max: 32.6 avg: 32.6 draw-call #> min: 4 max: 4 avg: 4 | batched: 20 tris #> min: 44 max: 44 avg: 44 | batched: 112 verts #> min: 88 max: 88 avg: 88 | batched: 80 player-detail> physx: 2.4 animation: 0.0 culling 0.0 skinning: 0.0 batching: 0.1 render: 1.3 fixed-update-count: 1 .. 1 mono-scripts> update: 2.3 fixedUpdate: 0.0 coroutines: 0.0 mono-memory> used heap: 339968 allocated heap: 479232 max number of collections: 0 collection total duration: 0.0


iPhone Unity internal profiler stats: cpu-player> min: 8.6 max: 8.6 avg: 8.6 cpu-ogles-drv> min: 0.3 max: 0.3 avg: 0.3 frametime> min: 49.8 max: 49.8 avg: 49.8 draw-call #> min: 4 max: 4 avg: 4 | batched: 20 tris #> min: 44 max: 44 avg: 44 | batched: 112 verts #> min: 88 max: 88 avg: 88 | batched: 80 player-detail> physx: 4.1 animation: 0.0 culling 0.0 skinning: 0.0 batching: 0.1 render: 1.4 fixed-update-count: 2 .. 2 mono-scripts> update: 2.5 fixedUpdate: 0.0 coroutines: 0.0 mono-memory> used heap: 339968 allocated heap: 479232 max number of collections: 0 collection total duration: 0.0


I can understand that I may have a spike in my game code for the first frame but what I really don't understand is the two other logs. Nothing seems different in terms of draw calls, memory, garbage collection and I'm having a quite big frame time difference. Is it something I should not worry about ?

Comment
Add comment · Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Bovine · Dec 23, 2011 at 05:50 PM 0
Share

Did you get to the bottom of this? I see similar stats. It's all good but the max CPU player time will be 10x it's average on occasion. :-(

avatar image JiminiCanett · Dec 23, 2011 at 06:21 PM 0
Share

Unfortunately, I didn't really solved the problem but it seems to come from the large textures I'm using, drawing 320*1024 textures is a bit overkill for the iPhone. It's not that bad but depending on other stuffs running during a frame it can slow down quite a lot. This kind of perf log is quite difficult to narrow down :/ If think there may be ways to optimize that but I've tried many kind of techniques and even if some things are improving the framerate stability, nothing has proven to be THE solution...

avatar image JiminiCanett · Dec 23, 2011 at 06:21 PM 0
Share

If I happen to really solve this problem, I'll post an answer.

avatar image Bovine · Dec 24, 2011 at 12:31 PM 0
Share

In the profiler cpp there is a nth frame setting for how frequently to output. This was very illu$$anonymous$$ating for my as it illustrated the breakdown of CPU-player on the spike frames, showing that my coroutines were occasionally taking 10+$$anonymous$$S and rendering spikes too. All the coroutine's time was spent in SetActiveRecursively() which can be slow. It was calling this every frame for about 60 gameobjects with a mixture of flat and high hierarchy. Changing this to just change the active property on a subset reduced the time to a more typical 1-3$$anonymous$$S

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Why do certain tasks in the profiler vary wildly in duration? 1 Answer

Can I get some profile output inside unity iphone's editor itself? 1 Answer

Spikes on iPhone3/4 every other minute. Any ideas how to find out why and/or get rid of them? 1 Answer

Analyzing iPhone Profiler in Xcode to increase game's performance 1 Answer

Unity profiler usually fails to connect to iPhone 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges