GithubHelp home page GithubHelp logo

Comments (3)

extrawurst avatar extrawurst commented on July 28, 2024

Did you measure what impact that has on performance?

from zenject.

svermeulen avatar svermeulen commented on July 28, 2024

Are you saying that we don't need to use this code anymore?

                return Resources.FindObjectsOfTypeAll<GameObject>()
                    .Where(x => x.transform.parent == null
                            && x.GetComponent<ProjectContext>() == null
                            && x.scene == scene);

That would be great since that's hacky and less performant than scene.GetRootGameObjects. But according to the comment in ZenUtilInternal.GetRootGameObjects, it doesn't work when executed during Awake

from zenject.

legoritma avatar legoritma commented on July 28, 2024

@svermeulen Yes exactly. I think this is the issue which is explained in the comment.https://issuetracker.unity3d.com/issues/scene-is-not-considered-loaded-when-awake-is-called

@extrawurst I wasn't remember the original ratios so tested again in our game on 2018.4.10 Editor.
Current method -> 317 KB GC, 3.95 ms
Suggested method -> 0.8 KB GC, 0.01 ms

from zenject.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.