Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
4
Question by Wrymnn · Oct 31, 2015 at 01:25 PM · c#slowcompilation

Slow script recompile time

My scripts compile at least 40+ seconds when I make some changes. Which is ridiculous. Do you have any idea what may cause it?

  • Both Unity and Project are on same SSD drive

  • Using only C#

  • Have less than 5000 lines of code, which is nothing

  • Have i5 (3.4GHz) and 12GB RAM, so speed should be really fast

  • Tried deleting Library and Temp folder from project so it reimports stuff, didn`t help

  • Don`t have McAfee, so it`s scanning cannot slow it down

Please, any idea would be really, really appreciated.

Comment
Add comment · Show 5
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image eelstork · Nov 01, 2015 at 09:38 AM 1
Share

$$anonymous$$ETA: 33 following this question, only 1 upvote. That's Unity answers for you.

avatar image Wrymnn eelstork · Nov 01, 2015 at 10:08 AM 0
Share

Yeah.... $$anonymous$$ore upvotes means more visibility for the Answer, which means this may help and speed up work for many other ppl....

avatar image Luisdong · Nov 04, 2015 at 04:08 AM 0
Share

I've got the same problem

avatar image eelstork Luisdong · Nov 04, 2015 at 05:59 AM 0
Share

So... do the below solutions work for you... ?

avatar image Wrymnn Luisdong · Nov 04, 2015 at 06:36 AM 0
Share

The speed seems to slow down every now and then, I just again, delete library and reimport all assets, but I think it`s the same.

2 Replies

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by Wrymnn · Nov 01, 2015 at 09:44 AM

It seems I have fixed the issue.

Not sure what was the cause but:

  • I added Unity and my Project to Avast exceptions

  • I went to Assets menu and Re-imported All

My guess is it was antivirus doing some monkey business there and slowing everything. Hope this helps somebody in the future.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image OhiraKyou · Feb 26, 2017 at 06:31 AM 0
Share

Thanks! Turns out, Avast was slowing my compile time down massively as well. After adding an exception for my project and Unity, everything was much faster.

avatar image CarterG81 · Aug 26, 2017 at 08:22 AM 0
Share

It seems that Crashplan/Dropbox monitoring my files causes compile times to go from 8s to 16s (double). Pausing Dropbox / Sleeping Crashplan seemed to have fixed my compile times.

avatar image
0

Answer by eelstork · Oct 31, 2015 at 02:18 PM

As far as I know (though I'm sure somebody will turn up and say the exact opposite) it's recompiling ALL your scripts every time - no incremental compilation. Anyway, there is a strong correlation between the amount of source you have and the compile time, I hope everybody would agree on this point.

Some claim that taking advantage of compilation order you can basically put stable code in a Plugins folder and it won't recompile every time. Last time I tested, inconclusive.

A more proven approach is to build DLLs for your stable code.

Having said that, 'ridiculous' isn't the right word. Compilation time largely depends on your hardware, the amount of code you're compiling, the target platform, the language. Yes, it is recommended to keep compilation times short (seen in textbooks: under 3 minutes). 15 seconds probably falls under the "bear with it" category.

Comment
Add comment · Show 4 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Wrymnn · Oct 31, 2015 at 05:09 PM 1
Share

That is the thing, I don`t have a lot of code, and for my PC specs, it just cannot compile that long. It wasn`t before at least. $$anonymous$$aybe there is some compilation settings I don`t know about.

avatar image eelstork Wrymnn · Nov 01, 2015 at 09:27 AM 0
Share

Was it a sudden change, or did it happen at once?

avatar image eelstork Wrymnn · Nov 01, 2015 at 09:36 AM 0
Share

If you're under version control you can compare how long it took say 2 weeks ago, and check how many lines of code you had then (you have a reliable way to measure this, right?). This (looking at previous revisions) may also help you discover the kind of sudden change (added third party code?) that might be slowing down your build.

Or maybe you can compare with another project/source? Is this your FIRST Unity project? If you're making assumptions based on your experience with another platform, these (assumptions) may not apply here.

I don't think 5000 lines of code is negligible when compiling C# with Unity, sorry.

Nor have I heard of any compilation settings that significantly speed up builds. Although I'm not sure whether your question is a duplicate, it's definitely not the first time somebody raise the issue.

Note: if you're not under version control this is a bigger problem than compile time.

avatar image Wrymnn eelstork · Nov 01, 2015 at 09:46 AM 0
Share

Thanks for the help, I really appreciate it :)

Though It seems I have managed to fix this issue, I have written possible source as Answer to this topic.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

33 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

Unity 2020.3.21f1 running slow 2 Answers

Code execution is slower in Unity then outside of Unity 0 Answers

Renderer on object disabled after level reload 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges