Closed kwasak closed 5 years ago
Hi @kwasak Thank you for reporting.
I would like to know more information on this issue. Unity version, platform, more profiler infomation...
You’re welcome! Unity 2018.3, iOS.
For the profiler information, the attached screenshot is all I got for profiler information.
On Apr 9, 2019, at 10:48 PM, Takashi Sakai notifications@github.com<mailto:notifications@github.com> wrote:
Hi @kwasakhttps://github.com/kwasak Thank you for reporting.
I would like to know more information on this issue. Unity version, platform, more profiler infomation...
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/mob-sakai/UIEffect/issues/163#issuecomment-481512551, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ABqdSu4RW8dXMiIxpW_vus9buazRPW7dks5vfVETgaJpZM4cl9av.
Thank you, @kwasak ! Can you submit a reproducible project for this issue? It helps me to resolve the issue.
Sorry, this took so long. I'm on a tight schedule with a project I'm working on.
It appears the issue stems from a call to MaterialResolver.GetOrGenerateMaterialVariant()
from UIShiny.
MaterialResolver.GetOrGenerateMaterialVariant()
calls GetMaterial()
which makes an expensive call to AssetDatabase.FindAsset()
. This call occurs for every UIShiny object in the scene.
As you can see from the attached image, in my case, this adds 3.7s to Assembly Reload Time.
AsGetOrGenerateMaterialVariant()
is called from OnValidate()
.
From what I see, the solution would be cache the material received from GetMaterial()
.
UISmartShiny is a class I inherited from UIShiny, for the purpose of this bug their identical, this occurs in both my version and the original UIShiny.
I hope this helps, I apologize again for the late reply.
@kwasak Oh, sorry. I missed this issue. I will fix it soon.
Awesome, great improvement. 41MB to 232KB is amazing!
On May 24, 2019, at 8:33 PM, Takashi Sakai notifications@github.com<mailto:notifications@github.com> wrote:
WIP [image]https://user-images.githubusercontent.com/12690315/58362249-1c9f2580-7ed0-11e9-97c0-2961cb142478.png
GC: 41.4MB -> 232.5KB
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/mob-sakai/UIEffect/issues/163?email_source=notifications&email_token=AANJ2SWEFG2KJFKBY3GIAKTPXCCPDA5CNFSM4HEX22X2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWGZY2A#issuecomment-495819880, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AANJ2SSNS7SYWEKR63DVGALPXCCPDANCNFSM4HEX22XQ.
The cause of the problem is that the material cache was not working properly. If there is no problem, it will be released. Try it on your project. :)
UIEffectBase.OnValidate() is increasing the amount of time it takes to enter playmode. In my project, UIEffectBase.OnValidate is adding an extra 2s.