Reduce compilation times

Could it be possible to reduce the compilation time?
At least you could add -j to use all the available cores, which will reduce compile times greatly on 4-8 core CPUs

@slawo, Do you mean reduce the compilation time with cocos command? And which platform are you compiling for?

In command cocos, you can use -j when compiling for platform android & linux. But not other platforms.

The command should be like this:
cocos compile -p android -j 4

Compiling for android: cocos compile -p android -j 8 works

But cocos compile -p android -j doesn’t work. I was expecting the default -j without a number to work as well. (Usually it defaults to the number of available cores). Would it be possible to add -j by default and override it when the user passes an additional value to -j?

Sorry for my late reply. The logic code of -j has been changed in this commit.

Before this commit, the default value of -j is 1. But now it’s using all available cores as default.

Thanks for your feedback and hope it’s helpful!

This is great news! Thank you!