Speed up xmake compile on Windows 10

Technical questions regarding the XTC tools and programming with XMOS.
Post Reply
User avatar
akp
XCore Expert
Posts: 578
Joined: Thu Nov 26, 2015 11:47 pm

Speed up xmake compile on Windows 10

Post by akp »

Hi,

I am not sure if this topic has been explored in the forums, but I think people probably know that compiling using xmake on Windows is pretty slow because xmake won't support the -j (--jobs) option to start parallel jobs. As an example for me, I have a project that will compile on Windows 10 in about nine minutes. This is for a build that uses a ton of files (in my case, xtcp library for one, among others).

However, if I boot my machine to Ubuntu it takes less than two minutes to compile because xmake can use all 4 logical cores of the Core i5 machine I am using. So roughly a 4x speedup due mostly to running 4 parallel jobs rather than 1 at a time.

I wanted to get some of this improvement while running Windows -- which I use for some other stuff besides XMOS development, so I'm not keen to switch over fully to Linux. Therefore, I tried running Lubuntu under virtualbox and providing it with 4 cores. Indeed that sped up a small build (from 45 seconds to 15 seconds), but the large build took even longer, so it's obviously bound by something else, like IO in the virtualized environment.

The good news is that Windows 10 has the Windows Subsystem for Linux, WSL. So I installed ubuntu and the XMOS toolchain, and lo and behold I cut the compile time to less than five minutes, almost a 50% improvement using xmake -j . Not as good as native Linux, probably due to the underlying filesystem inefficiencies in Windows and on-access virus scanning of my source files (which I can't disable at present). But still a very substantial improvement.

I have even run the Linux IDE under WSL using a Windows X server but what I understand about WSL is that USB isn't well supported yet, so I didn't try the XTAG. So as of now I am building my project with the Linux command line tools and editing and running it with the Windows IDE. One issue I have noticed is some weirdness if I do a full build in Linux, then make a change in the Windows IDE, and then do an incremental build in Windows. Perhaps I can set up some kind of script to call the WSL/Linux builder from the Windows IDE. I am still investigating this issue.


Post Reply