5.2 Editor blocks for ~7s when shader gets selected

Hi,

since about Unity 5.2, every first time we select one of our objects containing a very big shader we use, the editor freezes for about 5 to 10 seconds. This happens after every playmode and after every assembly reload (script compile).

Although this is not a life threatening issue, its still quite annoying. Is there any way to pre-compile the shader from script code or have it cached somewhere? Or any other solution how to avoid these freezes?

(We got some other “several second editor freezes” as well, e.g. when playmaker decides to initialize or some other code does a GetAssemblies().GetTypes() for the first time, so we are already quite used to these. Still… annoying every-day-working-hickups)

Ah… never mind. It was actually caused by one of our material editor scripts that did some unnecessary huge amount of operations the first time it gets executed.