Exporting to Webgl is very slow

Viewed 5906

It always stuck at IL2CPP for more than 10 minutes. why and how to speed up the process? I have tried the examples found such as exporting to the same folder.

2 Answers

The WebGL build toolchain involves a number of different tools, so the build time can take a while (we're working to improve build times with IL2CPP and related toolchains now). There are a few general tips which can help improve build times here:

https://docs.unity3d.com/Manual/IL2CPP-OptimizingBuildTimes.html

Most of the build time will be spent on disk I/O in many cases, so making that as fast as possible is likely your best option.

This is true for software development in general, but I wanted to make it clear that you are NOT limited by your hardware nowadays. I recently transitioned my game to Gitlab and set up a full CICD flow based on this really cool open-source project. Every change I make automatically gets built in the cloud (on powerful computers that I didn't buy and don't pay for), and I can download the completed build when it is done.

If you have a spare computer in the house, you can use that as a build server instead (via Gitlab, Jenkins, or file sharing and manual compilation)

Finally, by making full use of the playmode editor and the profiler, you can minimize the number of times that you really need to be building in the first place. If you complete a full WebGl build only to discover that a bug makes the game unplayable, you should treat it as a failure in your process. 9 times out of 10, you could have found the bug through some other means (unit testing, playmode testing, etc.) without the need to build and deploy your full project. There are exceptions here, WebGl accesses files uniquely, so a Windows build might work where a WebGl build fails, for example.

Software takes time to build in general, and I don't think Unity is particularly bad when compared to other projects I've worked on. It can be frustrating when you have to wait for your build to finish in order to know if things are really working as you expected, but you shouldn't ever have to walk away from your computer because it is busy compiling when you would rather be working. There are many tools and solutions that can enable you to keep working even when your build times pass the one hour mark!

Related