Bug report: Mbed OS takes 30+ minutes to compile on an NTFS drive


When using Mbed Studio 1.4.4 on Ubuntu 20.04, Kernel 5.4.0, the mbed-os build process takes about 20 minutes and “Run program” is stuck on “Scan: APPNAME” in the “Output” tab for >10 minutes.

The project files are found on my Windows partition which is mounted as follows:

$ mount -l | grep pwin
/dev/sda2 on /media/pwin type fuseblk (rw,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096) [Windows]

Steps to reproduce:

  1. Have an NTFS drive mounted
  2. Try to compile mbed OS
  3. the process “mount.ntfs” slowly increases the CPU load from 0% to 100% (single core)
  4. Suffer
  5. At the end, the compiler kindly notifies you that it took more than 5 minutes to compile (no shit Sherlock!)

Moving the project to the Linux ext4 partition solves the issue. Thus I assume the IDE queries the same files too often or too fast, resulting in a full queue of operations to process by the ntfs-3g driver. Might there be optimization potential to reduce file lookups (recursive searches, for example?) or to at least warn the user when this configuration is used?


Thank you for your post. We’ll make a note of it, but we probably won’t be able to investigate as there could be a number of reasons that could cause the slowness in your set up. (see https://www.reddit.com/r/linuxquestions/comments/73v5pi/why_is_ntfs_on_linux_so_slow/)

Many thanks

Thank you for the input. I changed fstab and after a reboot it does appear to build a bit faster. I however would rather not want to rebuild the entire thing because the mount.ntfs still shows a noticeable overhead (CPU usage) when loading the project.

I hope there’s potential for improvement in mbed Studio and that the new ntfs kernel driver will yield better performance in the future.