• 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 /
  • Help Room /
avatar image
1
Question by xkatrakis · Sep 13, 2016 at 12:39 PM · androidandroid buildlagprofilerspikes

Device.present causing unexplainable slowdown

Hello. I've been working on an Android game for some weeks now and i am facing the following problem. Right now the game consists of 3 scenes: Splash, Story and Game. Sometimes the game will launch just fine, ac$$anonymous$$eving a smooth 60fps from the Story to the Game Scene. Other times the game will launch with a terrible 15fps, w$$anonymous$$ch the profiler shows is mostly due to device.present taking up to 80%. That can happen if i terminate the app completely and i also recall it happening even when the phone screen dims w$$anonymous$$le on Story and i press to wake it up. The slow fps will continue through to the Game scene. I know similar questions have been asked before, but i haven't find someone else reporting such inconsistent behavior.

Unity version is 5.4.0f3 and the testing device is a Galaxy Note 5. I am using Application.targetFrameRate= 60fps. Below are 2 screenshots of the Profiler window, taken at roughly the same time into the game, showing the difference i'm talking about.

Thank you in advance

alt text alt text

capture1.png (156.9 kB)
capture.png (204.7 kB)
Comment
Add comment · Show 1
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 doublemax · Sep 14, 2016 at 06:06 AM 0
Share

Device.present doesn't look like a function that should be called every time. Are you calling it yourself in your code? If not, maybe you can find out where it is used.

3 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by xkatrakis · Sep 16, 2016 at 11:07 PM

Turns out that even for simple scenes the standard shaders are really cutting away performance. Replaced all shaders with mobile ones, also put the default sprite material on the sprites that didn't have one (not sure if that helped at all) and i'm back at 60 fps!

Comment
Add comment · Show 2 · Share
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 Velocity42 · Dec 04, 2017 at 06:09 PM 0
Share

Thank you! With this tip I went from 15 fps to 30 fps. Still a ways to go but that was very helpful.

avatar image gari090 · Jun 25, 2020 at 11:26 AM 0
Share

What shader did you use for the mobile?

avatar image
0

Answer by IgorAherne · May 31, 2018 at 03:32 AM

Yep, also check t$$anonymous$$s out (post #7) https://forum.unity.com/threads/device-present-in-profiler-what-the-deal.86312/#post-556133

Comment
Add comment · Share
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
0

Answer by tdx110 · Feb 10, 2021 at 05:26 PM

I found the solution! In Build Setting furn off: 1.Deep Profiling Support 2. Script Debugging!

I t$$anonymous$$nk Device.present is when compiling for preview. If you disable Developmen Build it will work normally.

PS: If you disable Autoconnect Profiler Game run faster! Much faster. If You disable Debug mode to Relase game go much better. alt text


zrzut-ekranu-1.png (55.9 kB)
Comment
Add comment · Share
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

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

75 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

My game are really smooth on Unity test but really really lagging after build on Android 0 Answers

MoveTowards used on a path causes lag in build 0 Answers

Spikes after half minute of running 1 Answer

Android apk lags on all devices exept of mine 0 Answers

What is UnityChoreograp? 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