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:
1 2 3 4 |
for ((i=0;i<5;i++)); do sync time (for ((j=1;j<=1000;j++)); do touch file$((i*1000+j)); done) done |
Results:
Number of files | Before | After | Improvement |
---|---|---|---|
1~1000 | 25.360s | 22.168s | 14.40% |
1001~2000 | 38.242s | 28.72s | 33.15% |
2001~3000 | 49.134s | 35.037s | 40.23% |
3001~4000 | 62.042s | 41.624s | 49.05% |
4001~5000 | 73.629s | 46.772s | 57.42% |
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.
Via Phoronix and Neowin. Thanks to TLS for the tip.
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.
Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress
> So basically the more files are created the better the relative performance
Huh? The more files created the bigger the absolute time saved which is a no-brainer. The relative ‘performance’ would need to take the amount of files created into account (dividing through this) and then it looks like this:
Whether this is a ‘trend’ showing lower relative performance at higher count of files or just results variation is irrelevant since a class 4 SD card is so crappy wrt random I/O performance that repeating the test with something reasonable (be it even the cheapest A1 rated SD card possible) will show no differences anyway.
I used “relative” with regard to percentage gains as the more you create files the longer it takes.
Reliability is the main issue for me. But I have had more success as I learned more. Flash filesystems are SBC’s weak point,IMHO