Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

[FREE] More Effective Coroutines

Discussion in 'Assets and Asset Store' started by Trinary, Feb 23, 2016.

  1. Trinary

    Trinary

    Joined:
    Jul 26, 2013
    Posts:
    386
    I'm really not sure how to answer this since "yield return Timing.WaitForOneFrame;" is not the kind of thing that can fail.
     
  2. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    314
    Not sure what the problem was exactly, a Unity thing - all is working fine now. Thanks!

    // Wildstyle
     
  3. funkyCoty

    funkyCoty

    Joined:
    May 22, 2018
    Posts:
    613
    Hey there. I just purchased the PRO version of MEC. Sorry if this has been asked before (big thread) but it seems that in 2021.3+, Unity's Coroutines are actually much faster than MEC, at least for my (simple?) setup. I've got thousands of units which all run a single simple coroutine each (generally short lived, or yielding most frames). I swapped out unity's coroutines with MEC pro and profiled before and after. In a non deep profile, MEC is ~7ms for ~500 units. Unity eats up about ~3ms for the same ~500 units doing the same amount of work.

    MEC

    Unity_paXe9WFTUU.png

    Unity
    Unity_ETXe6nSJWT.png

    An example of how I swapped it out (seemed pretty straightforward?)
    Fork_fn82D6Mp9W.png

    Could there have been something I did wrong during setup to cause this? Or have Unity coroutines just gotten better since MEC was made?

    Edit: I was emailing the developer about this so I could be 100% sure I didn't do anything wrong. But, he confirmed that yes, MEC is just slower. He was also extremely rude, but that's aside the point. It's unfortunate, oh well.
     
    Last edited: Jan 18, 2023
  4. DwinTeimlon

    DwinTeimlon

    Joined:
    Feb 25, 2016
    Posts:
    245

    OMG, thanks so much for testing this out. I am using this for quite some time and was wondering if Unitys Coroutine improved. Oh well so I have to refactor a ton of code now and get rid of that thing.