Lots of stuff happens here, but Asmdef files shouldn’t impact this step too much.Īsmdef files allow us to break up our game up into smaller assemblies. The Unity update step puts the game and everything all back together again. The docs say that they reference all asmdef files, but it practice it seems that only asmdef files with the "Auto Referenced" checkbox marked. Everything not included in a folder covered by an asmdef file is built into the Assembly-CSharp or Assembly-CSharp.Editor assemblies. This is the step Asmdef files should help with. The Unity compile step calls the C# compiler to build the projects the Unity refresh determined need to be compiled. Even so, for a single file, this is really fast. Unity will only build the file if the new hash is different. Unity being different, reads the entirety of every file that has changed to compute a hash. Most build systems keep track of time stamps and rebuild if the change time of the file is different. The Unity refresh looks for all the files that have changed, and makes a list of the projects that depend on those files. Unfortunately, it seems Unity doesn’t use MSBuild (or at least I can’t figure out how to get Unity to output a MSBuild Performance Summary.) So instead, I scraped Unity editor logs to figure out what Unity does. Was this worth it? “I have a need for speed”įor normal C# projects, we can call MSBuild directly a get a Performance Summary for a build. In the end, I got it down to around 5 seconds. Under test conditions my build took more like 8 seconds. I’m not sure why Unity was taking 30 seconds then. “What’s going on here.” Thus began my week long adventure to speed up my build times. Putting all my external code into an asmdef reduce my compile time by 75%
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |