unity-jar-resolver icon indicating copy to clipboard operation
unity-jar-resolver copied to clipboard

Unity Loads for 2 minuites every single time play is pressed.

Open pineda1000 opened this issue 4 years ago • 23 comments

We are working on a huge project. 100k -ish files

Every single time Play is pressed on unity editor it hangs for around 2 minuites.

I tried to isolate the issue.

steps i tried. 1.) I moved from version 122 to version 150. 2.) unchecking everything that i can uncheck in the settings.

I also tried to disable every dll. in the folder. aside from the Google.VersionHandlerImpl

it still loads for an unacceptable amount of time.

This however does not happen when i try it in a empty project.

I also are unable to profile on what in the DLL's are triggering this massive spike in loading time. as the calls in a DLL does not show up in a profiler.

I can now fix the issue by importing the ExternalDependencyManager once in a while when building, and disable them after...

UNITY VERSION 2019.3.X

pineda1000 avatar Apr 11 '20 08:04 pineda1000

Hi, I think I have the same issue. Initially, I thought it was firebase dependencies, but I think it comes from the dependency manager. Here is the result of running the profiler in Editor mode, this is caught in one of the first frames: profiler

In my case, this IOSResolver is taking about 50% of the startup time. Note that I'm running on windows and building for android. So I don't understand why IOSResolver needs to run here.

MateusMP avatar Apr 19 '20 15:04 MateusMP

I'm also having this problem, though for me the slowdown occurs in generate_xml_from_google_services_json.

GorillaOne avatar Apr 21 '20 22:04 GorillaOne

It is the dependency manager. Removing it resolves the issue, though of course then you can't use Firebase because it has a dependency on the resolver. I'm currently working my way back from 6.13.0 on the Firebase Unity SDK to find one which includes and relies on a version of the dependency manager where this slowdown doesn't exist.

GorillaOne avatar Apr 22 '20 23:04 GorillaOne

I have the same problem. Not only entering Play mode causes this issue but every compilation for me. Verbose Logging shows a lot of iOS-related stuff going on. I'm on Windows, building for Android. Unity 2019.3.9.

kvanonavk avatar Apr 27 '20 13:04 kvanonavk

Here they talk a bit more of why this is happening. It would be really great to take those validation the resolver do. It's making the development process really hard. https://github.com/googlesamples/unity-jar-resolver/issues/327

MartinGonzalez avatar Apr 27 '20 18:04 MartinGonzalez

unity-jar-resolver_profiler Happens every time when entering play state. Adding -gvh_disable to command line and turning everything off from settings does not fix the issue. Only choice is to delete whole folder until those static constructors are fixed.

JaniAl avatar Apr 29 '20 10:04 JaniAl

image I'm also experiencing massive slowdowns on entering the playmode. (And sometimes just beeing in the editor as well)

Using EDM + Firebase Plugins

Deleting EDM + the firebase editor folders solves the issue for me. I'm still keeping them in my git in case something is ever needed.

MWFIAE avatar May 04 '20 19:05 MWFIAE

We are too started experience lockdowns on start after installing Firebase + EDM.

miv avatar May 06 '20 15:05 miv

We are experiencing the same behaviour on our projets. It is slowing grinding our working hours for nothing.

bhallionOhbibi avatar May 07 '20 15:05 bhallionOhbibi

So, this is actually two-fold problem! It is EDM and it is Firebase plugin. Both are slowing down DRAMATICALLY.

We've removed firebase and edm from our manifest.json and adding edm and firebase on build servers (by copying separate manifest on top of main one), putting all firebase code behind compile time define 🤦🏻‍♂️

The change in speed incredible - we were having 10 seconds hangups on every Play, now play start instantly.

miv avatar May 07 '20 15:05 miv

For us the main problem is in Firebase.Editor.dll which calls python process on every recompile and when entering play mode. This call takes 10 seconds on its own. Then another 5 seconds are added by IOSResolver, PlayServicesResolver, GPGSUpgrader. Waiting for 15 seconds after each compile and when entering play mode is killing us.

igor84 avatar May 11 '20 15:05 igor84

Sadly this is happening too in every project we have firebase. And we can confirm too that is Firebase dependency what is causing this.

This is REALLY annoying and it's complicating our development process. If we can help in anything please let us know, but we need to reduce this time.

MartinGonzalez avatar May 14 '20 16:05 MartinGonzalez

Can we please have ANY update from the Firebase team? This wastes hours of development for every team member.

jimanjr avatar May 16 '20 12:05 jimanjr

This issue is also related I think: firebase/firebase-unity-sdk#378

Whyser avatar May 18 '20 09:05 Whyser

Same issue at my company across multiple projects.

Currently I end up deleting the play services resolver when developing code, and then having to remember to not commit to version control/re-add it when I want to do a build.

Ridiculous, and this has been an issue for years.

arycama avatar May 19 '20 00:05 arycama

Same problem. Firebase + Play Services == Horrible experience for developers.

StupydHors avatar May 21 '20 14:05 StupydHors

Yep it's causing issues for me too.

edelventhal avatar Jul 16 '20 20:07 edelventhal

Still having this issue :( I'm not using Firebase - I am just using the standard Google Play services that come with the old PlayServicesResolver, which I replaced with the new External Dependency Manager.

The PackageManagerResolver, however it looks for XML files, is causing massive slowdown for us, are there any quick workarounds? Using Unity 2019.3.0f3

image

Vixxd avatar Sep 01 '20 18:09 Vixxd

I manually downloaded the unreleased 1.2.157 from the root of this repository - the Package Manager Resolver issue is no longer happening!

However, VersionHandlerImpl.dll is still causing a 12~ second lag spike on every 'Play', even in an empty scene.

The problem methods seem to be:

Any help would be appreciated - I am using this with EasySave3, could that be causing an asset db problem?

I also noticed some people having an issue with the Version Handler when passing certain command line arguments - I open via the Unity hub, and have tested both choosing 'Android' from the dropdown menu and 'Current Platform' - no change.

image

Unity Hub 2.3.2 Unity Editor 2019.3.0f3

EDIT: This still happens even when adding -gvh_disable as a flag via the Unity Hub Advanced options image

EDITed again (!): I thought the results in the Profiler above were still happening even when I added -gvh_disable as a flag via the Unity Hub Advanced options, but deleting my Library folder & relaunching Unity again made the -gvh_disable flag work as expected.

I migrated the EDM4U to be managed by the package managed, and deleting the one folder at Library\PackageCache\com.google.external-dependency-manager@xxx at project start-up when it is regenerated is working for now.

Vixxd avatar Sep 01 '20 22:09 Vixxd

Hi @Vixxd

If VersionHandler is causing performance issue on your system, I would recommend you to turn off Version Handler through settings. You should find it under Assets > External Dependency Manager > Version Handler > Settings. -gvh_disable would work too but you will shut off Version Handler entirely and cannot manually activate it when you need to.

I would still recommend you to run Assets > External Dependency Manager > Version Handler > Update when you upgrade Firebase, if it is installed through .unitypackage.

If you install Firebase or EDM4U from Unity Package Manager, since UPM is managing versions, Version Handler most likely will not do anything.

Hope this helps!

We are also looking into several way to improve editor performance for both Firebase and EDM4U. Will keep you updated.

Shawn

chkuang-g avatar Sep 23 '20 22:09 chkuang-g

I'm on 1.2.161 and I still see massive spikes when compiling scripts, entering and exiting playmode.

image

The problem is these two static intializers. They run always after assembly reload: code compilation and entering playmode.

https://github.com/googlesamples/unity-jar-resolver/blob/db7b0537ccccce8eeeade542f3a5aec3cfb9cddd/source/VersionHandlerImpl/src/VersionHandlerImpl.cs#L2301

https://github.com/googlesamples/unity-jar-resolver/blob/db7b0537ccccce8eeeade542f3a5aec3cfb9cddd/source/VersionHandlerImpl/src/VersionHandlerImpl.cs#L3086

We can't just disable the EDM as it needs to run on the build server, and there is no command line option to enable it, only disable. Luckily you can provide a command line option in Unity Hub for the project, but it's rather inconvenient as every developer needs to remember to set it for every checkout of the project.

However, it doesn't really fix the whole issue. This is profiling after -gvh_disable:

image

BuildTargetChecker and PackageManagerResolver are still happily chugging along.

Also, as a insult it also prints this in the log every time:

image

What I would like to have is a way to BY DEFAULT disable everything related to EDM, and then have a command line flag to enable it for the build server.

Can we have this in user friendly way, please? I'm compiling and running the game hundreds of times per day, and literally waiting half an hour just to EDM to do nothing really.

snlehton avatar Oct 30 '20 09:10 snlehton

Hi guys. I've send a fix proposal for that performance issue on https://github.com/googlesamples/unity-jar-resolver/pull/413 please make a review and send any feedback if possible.

felipegodias avatar Nov 12 '20 15:11 felipegodias

@felipegodias

Thanks for the PR. I will make another EDM4U release later next week. If you need the change right now, you should be able to use gradle to make a local build.

I feel pretty bad about the performance of EDM4U and will continue to push the team to improve this in the future.

chkuang-g avatar Nov 14 '20 07:11 chkuang-g