The exFAT file system is about to get faster in Linux 6.2, at least when creating files and directories, with the performance boost especially noticeable on low-end processors.
Microsoft released the exFAT specification and announced Linux support in August 2019, which was followed by a new exFAT implementation in Linux 5.7 (June 2020) from Samsung. But people are still working on improving exFAT Linux support, and Yuezhang Mo, an engineer at Sony, committed a patchset for Linux 6.2 that reduces repeated traversal of directory entries to boost the performance of exFAT:
After traversing all directory entries, hint the empty directory entry no matter whether or not there are enough empty directory entries.
After this commit, hint the empty directory entries like this:
1. Hint the deleted directory entries if enough;
2. Hint the deleted and unused directory entries which at the end of the cluster chain no matter whether enough or not (Add by this commit);
3. If no any empty directory entries, hint the empty directory entries in the new cluster(Add by this commit).
This avoids repeated traversal of directory entries, reduces CPU usage, and improves the performance of creating files and directories(especially on low-performance CPUs).
Yuezhang tested the patch on an NXP i.MX6 platform (i.MX6q SABRE Lite development board) using a Class 4 MicroSD card and found improvements from 14.4% to 57.4% depending on many new files were created using the following code:
for ((i=0;i<5;i++)); do
time (for ((j=1;j<=1000;j++)); do touch file$((i*1000+j)); done)
|Number of files||Before||After||Improvement|
So basically the more files are created the better the relative performance, and this can be noticeable by the user has the new patch saves about 27 seconds when creating 5,000 files on this specific platform.
Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting to write daily news, and reviews full time later in 2011.