Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] MonoAllocation #2

Open
aprius opened this issue Dec 24, 2022 · 0 comments
Open

[Question] MonoAllocation #2

aprius opened this issue Dec 24, 2022 · 0 comments

Comments

@aprius
Copy link

aprius commented Dec 24, 2022

When I test Get and GetCached vs default GetComponent of MonoAllocation with profiler.

Get is samilar with GetComponent , GetCached is create more gc and not faster than Get

It seems storage alway equals null

storage ??= new Dictionary<int, Component>(16);

Even after using the ref keyword so that the Dictionary re-creation does not happen, the speed is still slower than the default and generates a lot of gc

So is there any reason to use them?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant