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 /
avatar image
3
Question by Bovine · Sep 25, 2011 at 12:20 PM · ioscoroutineupdatefixedupdateefficiency

How efficient is Update() vs Update via a Manager vs Coroutines for iOS Deployment?

HI All

I am trying to decide whether I should update multiple entities (such as enemies) in game each in their own Update() method, or whether it is worth having a master update against which each entity is registered and for the master update to update each entity in its update, or whether each entity should run its own Coroutine to do updating, perhaps only for certain things such as moving from one point to another - presumably running a Coroutine for every frame would be no less efficient than running Update()? Perhaps easier to yield and continue however?

I'm developing for iOS so trying to use the best approach now rather than have to retrofit later. Currently I have a mix of Update(), FixedUpdate() and Coroutines.

Interested to hear what other people are doing and whether they've seen or know about particular performance considerations between these options or if anyone who knows the deeper workings can enlighten me?

Thanks a lot!

Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Eric5h5 · Sep 26, 2011 at 05:31 PM

Update is for things that happen every single frame. FixedUpdate is for physics. Coroutines are for everything else (InvokeRepeating can also be useful). Whether you should have a "master Update" depends on the number of objects; if it's just a few, it's not worth the extra development time.

Comment
Add comment · Show 1 · 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 Bovine · Sep 29, 2011 at 06:24 AM 0
Share

$$anonymous$$y current approach is to use a Coroutine WaitForFixedUpdate() to move my tile-based controllers around the game ins$$anonymous$$d of always trying to do work in FixedUpdate() - it feels like it ought to be moe efficient as nothing happens unless it should.

I've recently started using AngryAnts behave library so the typical pattern there is to Start as a Coroutine, and yield for several frames using WaitForSeconds(), so in many respects the updating process for enemies at least is out of my hands while ever I stick with that pattern.

Sounds like Update() is fine for a few things as you say but as the number increases something else has the potential to be more efficient. Sounds like the gain in efficiency will be directly related to the quantity of the thing involved or the amount of work saved?

avatar image
0

Answer by IndieForger · Feb 17, 2013 at 04:24 AM

I don't have experience with IOS but I run few tests regarding particle system and coroutines vs updates and it always depends on the case. You can find my observations here

Comment
Add comment · Show 1 · 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 Bovine · Feb 17, 2013 at 07:13 AM 0
Share

I don't see any benchmarks or observations - it looks like conjecture, did you compare each method and capture metrics on efficiency?

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

What's the cheapest way to run a method every few frames? 1 Answer

Animation Curve or Coroutine? Performance question. 1 Answer

Loading AssetBundle in Unity 3D drops the FPS drastically 0 Answers

Rigidbody.AddForceAtPosition & functions 1 Answer

Eliminating input loss 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