In order to see what this file system really brings to the table I decided to run some benchmarks, in a controlled environment, trying to eliminate as many fluctuation factors as possible.
The methodology is described below.
For this first round, only the /data & /cache partitions were formatted as f2fs, in order to see what kind of improvement we would be able to get out of formatting /system as f2fs too later on.
- Fully wiped and fresh install of the 26/03 CM nightly
- PA Gapps installed (pa_gapps-modular-full-4.4.2-20140301-signed) & updated
- Additionnal apps installed:
- Pimp My Z1
- Disk Info
- Benchmark apps
- No other app active in the background during benchmarks
- Fresh reboot before running the batch of benchmarks
- Airplane mode enabled (except for quadrant which requires an internet connection to show the results)
- Order of the benchmarks:
- RL Bench
- CF Bench
- 5 minutes pause with powersave governor to cool down the device
- Pimp My Z1 Settings:
- CPU Governor: performance (in order to eliminate differences due to frequency scaling, as this governor just stays at max freq all the time).
- GPU Governor: performance
- GPU Max Freq: 600MHz
- Intelliplug: disabled
- Dynamic Fsync: enabled
- I/O Scheduler: FIOPS for both emmc & sdcard
- Readahead: 1024kb for both emmc & sdcard
- Entropy contribution: disabled for both emmc & sdcard
- PowerSuspend: disabled
- KSM: enabled, 512 pages-to-scan, 500ms timer
- Thermal throttling: disabled
One thing I noted is that F2FS has a much higher usage of the /cache partition than ext4, which is to be expected coming from a log-based file system such as F2FS.
As you can see in the screenshots below (ext4 on the left & f2fs on the right), only 4mb out of the 192mb /cache partition is used by ext4, while f2fs uses 68% of that same partition with 114mb used.
Another thing to note is that under f2fs, the reported size of the /cache partition is apparently 2mb larger than on ext4, with 198mb.
EXT4 / F2FS
1. RL Bench
RL Bench is an SQLite benchmark, it only tests database read/writes with various SQL commands in various amounts.
As we can see in the results below, f2fs trumps ext4 with an overall time of only 14.417 seconds versus the 21.403 seconds of the latter.
Androbench is supposedly an all-around I/O benchmark.
On this one, the results were so incredibly appart that I think we can safely assume a big part of these results are due to poor coding on the benchmark side.
Still, if we believe the results, f2fs provides slightly slower reads (51mbps vs 66mbps) but over 120x faster sequential writes & 300x faster random write speeds!
I had to reboot and run it a second time to make sure this wasn't an error, but the second run results were even a bit better, as you can see in the screenshots below.
CF-Bench is an overall benchmark by Chainfire which measure everything except graphics.
Here again, f2fs is the winner with a better overall score.
That being said, the native writes are a little inferior to the ext4 native write score with 529 vs 535, but has a higher native read score with 996 vs 913.
This reliable open-source benchmark by 0xlab is an overall benchmark used by the Linaro android team during their famous toolchain demonstration.
It has the advantage to output the results in text, xml and json, which you can download below.
Strangely, on Linpack, ext4 gets a better score with 156mflops/s vs 122mflops/s for f2fs.
On the other hand, Scimark2 reports better mflops/s scores for f2fs in all 6 of its tests, as seen below:
Results in Mflops/s
Scimark2 ------------------------------------------------------------ Composite: 191.7992650532917 Fast Fourier Transform: 121.33004358991259 Jacobi Successive Over-relaxation: 431.85904395507 Monte Carlo integration: 10.79962368351458 Sparse matrix multiply: 132.34248411160723 dense LU matrix factorization: 262.6651299263541
Results in Mflops/s
Scimark2 ------------------------------------------------------------ Composite: 195.01022812596952 Fast Fourier Transform: 125.55719947408143 Jacobi Successive Over-relaxation: 436.3575761486842 Monte Carlo integration: 11.192272530363814 Sparse matrix multiply: 138.67117163604067 dense LU matrix factorization: 263.27292084067756
F2FS full results: http://d-h.st/iOf
5. AnTuTu Benchmark
No need for an introduction, it's probably the most popular benchmark these days.
On this one again, f2fs is the clear winner with a difference of over 1200 points.
6. Quadrant Benchmark
Another overall mainstream type of benchmark.
F2FS wins on this one too, with an advantage of 1100+ points.
EXT4 / F2FS
Conclusion, F2FS actually is an improvement over Ext4 for flash devices, and considering its very young age it will most likely be improved over time.