Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • 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, achieving a smooth 60fps from the Story to the Game Scene. Other times the game will launch with a terrible 15fps, which 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 while 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 this 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 think 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.

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

What is UnityChoreograp? 0 Answers

MoveTowards used on a path causes lag in build 0 Answers

Physics2D lag on increased timescale 1 Answer

Spikes after half minute of running 1 Answer


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