Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

Compiling 8 minutes for every script change

Discussion in 'Editor & General Support' started by retraffic, Jul 18, 2018.

  1. retraffic

    retraffic

    Joined:
    Jul 2, 2014
    Posts:
    13
    Hello,
    since a month or so Unity has started compiling for 8 minutes whenever there's the smallest change in a script. I understand that the assembly has to be recompiled, but 8 minutes seems a bit long. I tried looking through the logs but haven't found anything specific that I could change. It seems like Unity is recompiling every single script in the whole project. Unity hasn't done this before and I don't know what we changed.

    Can somebody please point me in the direction of where to look for possible problems?

    Also: we are on Unity 2017.1.1f1 which we can't change because migrating to a new version has a lot of problems too for a big project like ours. Same problem also happens on both Windows and Mac machines.

    Best,
    Kevin
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,829
    How many scripts do you have in your project? Thats seems like quite a significant delay.
    During a reload any editor scripts will also be re-initialized so if you have some that do a significant amount of startup work, parsing files etc then it could be and more than likely is this.
    Try running the profiler in editor mode with a deep profile, maybe you can catch if something else is causing the delay.
    I would also suggest you look into upgrading and try and solve the issues you are having. If you move to 2017.3(ideally 2017.4 LTS) you can use assembly definition files which are there just for this problem.
    Alternatively, you could look to compiling some of your scripts into .net assembly dlls yourself and put them into the unity project.
     
  3. retraffic

    retraffic

    Joined:
    Jul 2, 2014
    Posts:
    13
    Thank you for your fast answer. We do have about 600 scripts right now. I'm not aware of editor scripts parsing files on startup. The logs also don't look like that's what it's doing, but honestly, I cannot read much into them. Maybe some plugin is doing something on startup, but we haven't added any plugins before the reload times started to rise that much.

    I've tried the deep profiler, but it's the same as the logs. I just don't know what I'm looking for.

    Upgrading Unity is not an option, because it would mean that we have to completely re-test 6 hours of gameplay several times. Sadly, Unity is just too fragile when it comes to migrating. Lost months because of that once.
     
  4. retraffic

    retraffic

    Joined:
    Jul 2, 2014
    Posts:
    13
    I managed to get it down to a little bit over 2 minutes by disabling avast antivirus and moving some plugin scripts into the Plugins folder, but I still feel like this is way longer than what it took just a few weeks ago.