Entitas icon indicating copy to clipboard operation
Entitas copied to clipboard

Jenny Code Generation sometimes takes extremely long (200 seconds instead of 5)

Open ghostbutter-games opened this issue 4 years ago • 7 comments

Hi,

I have a problem with Jenny sometimes taking forever to generate the code. The things I do are: Open cmd line > Jenny.exe gen This usually generates about 200 files in ~5 seconds. Only problem is, about 50% of the time, but never on the first try, it takes almost exactly 200 seconds.

Is this a known issue? I have used Entitas for a couple of years now and this only started happening recently after I upgraded both Rider (to 2019.3) and Unity (to 2019.3.2f1)

Can anyone look into this?

Cheers

ghostbutter-games avatar Apr 13 '20 11:04 ghostbutter-games

Try to start server listener, instead of using bat file, maybe it need a some kind of warmup ? Also you may see console output.

WeslomPo avatar Apr 21 '20 17:04 WeslomPo

I experienced this too, but it's gone for me. I think it has sth to do with roslyn having a hard time parsing the project. Unity -> Open C# project usually fixed it for me.

Does this help?

sschmid avatar Apr 25 '20 17:04 sschmid

I experienced this too, but it's gone for me. I think it has sth to do with roslyn having a hard time parsing the project. Unity -> Open C# project usually fixed it for me.

Does this help?

I tried Assets -> Open C# Project but it didn't change anything for me. It seems really really random.. I just upgraded my PC and now it's down to 100 seconds, but still..I have no idea what causes this. Firewall can't be the cause because I added exceptions already.

EDIT: The problem seems to be occurring mostly when I create e.g. a new component from within Rider directly, without reloading Unity Editor. When I create a component from within Unity, close Rider then open it again via Unity -> Assets -> Open C# project, then run Jenny.exe gen from within Rider, it seems to work..for now.

ghostbutter-games avatar Apr 29 '20 11:04 ghostbutter-games

I always create new components in rider without switching to Unity. Did you try deleting the solution and all csproj files and regenerating them with Unity?

sschmid avatar Apr 29 '20 12:04 sschmid

I always create new components in rider without switching to Unity. Did you try deleting the solution and all csproj files and regenerating them with Unity?

Yes, did try that already. Doesn't seem to change anything. I mean: I used Entitas for ~2 years with not issues at all regarding code generation and this only started happening a couple months ago when I switched Unity and Rider versions..

ghostbutter-games avatar Apr 29 '20 12:04 ghostbutter-games

Hey! I've encountered this issue several months ago. Gentlemen in gitter didn't seem to have it so they didn't help much. But. What I've found myself is that the problem is caused by one of the PostProcessors. It seems to be leaving file resources open and not releasing it's handle. Here is the bastard. Try removing this line from your Jenny.properties and see if it helps.

DesperateDevs.CodeGeneration.Plugins.UpdateCSProjPostProcessor, \

Phist avatar May 05 '20 13:05 Phist

@Phist hm, are you sure? This post processor only uses File.WriteAllText(), looks fine to me.

@konsuko Can you try with Entitas 1.14.0, it's now using dotnet instead of mono and should run faster:

dotnet Jenny/Jenny.Generator.Cli.dll gen

sschmid avatar Sep 07 '22 12:09 sschmid

I remember having this once, too.

I closed Unity and Rider and resetted my project with

git clean -ffdx

This helped in my case!

sschmid avatar Jul 03 '23 13:07 sschmid