Flash File System Evaluations
The web is full of JFFS2 vs. YAFFS2 vs. UBIFS benchmarks, but since they tend to be very subjective, I decided to measure what is important for my particular application, i.e. mount time, writing performance and file system scan. I tested all three on ARM9-based AT91SAM926 processor with 64MB NAND flash and 128MB SDRAM, running Linux 2.6.32 kernel with the latest YAFFS2 patch. Not surprisingly, both YAFFS2 and UBIFS performed significantly better than JFFS2. What was more surprising is the fact that both YAFFS2 and UBIFS performance was very similar. Mount time was measured using:
time mount -t jffs2 /dev/mtdblock0 /tmp/test/ time mount -t yaffs /dev/mtdblock0 /tmp/test time mount -t ubifs ubi0:test /tmp/test
Write time using:
time tar xf /test/rootfs.arm.tar
That created a 81MB file system with 1865 files and read time using:
time du -shc /tmp/test/
That scans the above file system. Table 1 summarizes the results.
|File system||Mount time||Write time||Read time|
As you can see, for some operations YAFFS2 is slightly faster than UBIFS, and for some it is the other way around. All in all, the difference does not look significant, at least for my sort of application, so I had a hard time choosing the right one for my FemtoLinux Project . Eventually, I decided to go with YAFFS2, as despite its "external patch" status it seems to be more reliable and easy to use than UBIFS and certainly has better track record in commercial products. Probably the only YAFFS2 disadvantage is the lack of compression support, however for most embedded applications it is probably not an issue.
YAFFS2 is distributed free of charge under the GPL license, however a different license is also available from Aleph One, which is a commercial company that develops and supports YAFFS. When YAFFS2 is used with the Linux kernel it is distributed under GPL, however for other situations different licenses terms are available.