Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,808,356 Members 38,609 Now Online
XDA Developers Android and Mobile Development Forum

[Benchmarks] File System Performance: F2FS vs EXT4

Tip us?
 
Androguide.fr
Old
(Last edited by Androguide.fr; 28th March 2014 at 12:23 AM.)
#1  
Androguide.fr's Avatar
Recognized Contributor - OP
Thanks Meter 6,971
Posts: 2,053
Join Date: Jul 2012
Location: Lyon, France

 
DONATE TO ME
Drive [Benchmarks] File System Performance: F2FS vs EXT4

I have recently implemented Samsung's Flash Friendly File System (F2FS) into my kernel for the Z1 (Pimped Kernel).

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.


Benchmarks Used

Methodology
  • 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
    • Androbench
    • CF Bench
    • 5 minutes pause with powersave governor to cool down the device
    • 0xBenchmark
    • AnTuTu
    • Quadrant

  • 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


Disk Usage
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.

EXT4


F2FS




2. Androbench
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.

EXT4


F2FS
1st Run


2nd Run




3. CF-Bench
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.

EXT4


F2FS




4. 0xBenchmark
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.

On the SunSpider javascript benchmark run, f2fs gets a better score with 744.5ms vs 792.0ms for ext4.
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:

EXT4 Scimark2
Results in Mflops/s
Code:
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
F2FS Scimark2
Results in Mflops/s
Code:
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
EXT4 full results: http://d-h.st/iER
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.

EXT4


F2FS




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.

Quote:
My Contributions
(Apps, Librairies, Roms & Guides)
 

Pimp My Rom: Website / App / Thread

dSploit: Website / Github

Flash Gordon (Flash zips without a recovery): Thread

Universal init.d: App

PlayView/CardsUI Library: Portal / Github

HoloGraph Library: Portal / Github

Ubuntu Touch for i9300: Thread

Omni nightlies for Xperia Z1: Thread

Paranoid Android builds: Thread

Revive your bricked p68xx : Guide
Follow me on Github
The Following 58 Users Say Thank You to Androguide.fr For This Useful Post: [ Click to Expand ]
 
Daelyn
Old
#2  
Daelyn's Avatar
Senior Member
Thanks Meter 155
Posts: 668
Join Date: Dec 2006
Nice review @Androguide.fr !
Looking forward to see F2FS being adopted.
 

========== Current hardware =================
Sony Xperia Z1 Black > Awaiting AOSP
Samsung Galaxy S3 Mini > Running AOSP
=============== Stolen =====================
Samsung Galaxy SIII // Pebble Blue
ROM: The cleanest AOSP found.
============= Retired section ================
HTC Desire AMOLED // Custom H-Boot
ROM: Oxygen 2.3.2 Clean and lean!
Radio: 32.54.00.32U_5.14.05.17 + RIL
 
Poesini
Old
#3  
Senior Member
Thanks Meter 82
Posts: 429
Join Date: Apr 2012
Location: Cali

 
DONATE TO ME
How are you getting 600 Mhz on the GPU?

I have

PHP Code:
root@honami:/sys/devices/fdb00000.qcom,kgsl-3d0/kgsl/kgsl-3d0 # cat gpu_available_frequencies
450000000 389000000 320000000 200000000 27000000 320000000 320000000 200000000 200000000 
root
@honami:/sys/devices/fdb00000.qcom,kgsl-3d0/kgsl/kgsl-3d0 # echo 600000000 > max_gpuclk
root@honami:/sys/devices/fdb00000.qcom,kgsl-3d0/kgsl/kgsl-3d0 # cat gpu_available_frequencies
450000000 389000000 320000000 200000000 27000000 320000000 320000000 200000000 20000000
root
@honami:/sys/devices/fdb00000.qcom,kgsl-3d0/kgsl/kgsl-3d0 # cat max_gpuclk
450000000 
And its still showing 450 on Pimp and Trickster
The Following User Says Thank You to Poesini For This Useful Post: [ Click to Expand ]
 
Androguide.fr
Old
(Last edited by Androguide.fr; 28th March 2014 at 03:44 PM.)
#4  
Androguide.fr's Avatar
Recognized Contributor - OP
Thanks Meter 6,971
Posts: 2,053
Join Date: Jul 2012
Location: Lyon, France

 
DONATE TO ME
Quote:
Originally Posted by Poesini View Post
How are you getting 600 Mhz on the GPU?

I have

PHP Code:
root@honami:/sys/devices/fdb00000.qcom,kgsl-3d0/kgsl/kgsl-3d0 # cat gpu_available_frequencies
450000000 389000000 320000000 200000000 27000000 320000000 320000000 200000000 200000000 
root
@honami:/sys/devices/fdb00000.qcom,kgsl-3d0/kgsl/kgsl-3d0 # echo 600000000 > max_gpuclk
root@honami:/sys/devices/fdb00000.qcom,kgsl-3d0/kgsl/kgsl-3d0 # cat gpu_available_frequencies
450000000 389000000 320000000 200000000 27000000 320000000 320000000 200000000 20000000
root
@honami:/sys/devices/fdb00000.qcom,kgsl-3d0/kgsl/kgsl-3d0 # cat max_gpuclk
450000000 
And its still showing 450 on Pimp and Trickster
You're probably just not running Pimped Kernel, otherwise you'd have 389 & 600 too.

EDIT: weird, you do have 389, but not 600.

Quote:
My Contributions
(Apps, Librairies, Roms & Guides)
 

Pimp My Rom: Website / App / Thread

dSploit: Website / Github

Flash Gordon (Flash zips without a recovery): Thread

Universal init.d: App

PlayView/CardsUI Library: Portal / Github

HoloGraph Library: Portal / Github

Ubuntu Touch for i9300: Thread

Omni nightlies for Xperia Z1: Thread

Paranoid Android builds: Thread

Revive your bricked p68xx : Guide
Follow me on Github
 
Poesini
Old
#5  
Senior Member
Thanks Meter 82
Posts: 429
Join Date: Apr 2012
Location: Cali

 
DONATE TO ME
I am running Pimped Kernel and I have reflashed it also (I have /cache and /data with f2fs)
 
Androguide.fr
Old
(Last edited by Androguide.fr; 28th March 2014 at 05:36 PM.)
#6  
Androguide.fr's Avatar
Recognized Contributor - OP
Thanks Meter 6,971
Posts: 2,053
Join Date: Jul 2012
Location: Lyon, France

 
DONATE TO ME
Quote:
Originally Posted by Poesini View Post
I am running Pimped Kernel and I have reflashed it also (I have /cache and /data with f2fs)
That's really weird. Which rom are you running ?
I'm also running the last F2FS build and here's my output :
Code:
cat /sys/devices/fdb00000.qcom,kgsl-3d0/kgsl/kgsl-3d0/gpu_available_frequencies
600000000 533333000 487500000 450000000 389000000 320000000 320000000 200000000 200000000
You have some messed-up steps, too, the 270MHz shouldn't be there, and certainly not after a 320MHz step, that's really weird.

Quote:
My Contributions
(Apps, Librairies, Roms & Guides)
 

Pimp My Rom: Website / App / Thread

dSploit: Website / Github

Flash Gordon (Flash zips without a recovery): Thread

Universal init.d: App

PlayView/CardsUI Library: Portal / Github

HoloGraph Library: Portal / Github

Ubuntu Touch for i9300: Thread

Omni nightlies for Xperia Z1: Thread

Paranoid Android builds: Thread

Revive your bricked p68xx : Guide
Follow me on Github
 
Poesini
Old
#7  
Senior Member
Thanks Meter 82
Posts: 429
Join Date: Apr 2012
Location: Cali

 
DONATE TO ME
I am using Omni 3/15 lol
 
mnickkk
Old
#8  
Member
Thanks Meter 5
Posts: 54
Join Date: Mar 2011
Quote:
Originally Posted by Entropy512 View Post
Some more information:

Beyond the anecdotal evidence above that f2fs has data integrity issues, I can now personally confirm that f2fs is far poorer than ext4 at data integrity.

In the process of bringing up omni, a bug was causing frequent reboots of the device during bootup. This caused a large number of "ghost files" on the filesystem. They would appear if you did "ls *" but spit out an error that they didn't exist. Not good when that happens on your dalvik cache.

These files couldn't be created, nor could their directory entries be deleted. An attempt to run fsck.f2fs would just crash with an assertion error. To fix the issue I had to completely reformat the /data partition. (Not just a typical wipe/factory reset which leaves the "sdcard" contents in /data/media)

With ext4, those files would have been deletable and fsck would've actually done something.
That's pretty worrisome.
 
Androguide.fr
Old
#9  
Androguide.fr's Avatar
Recognized Contributor - OP
Thanks Meter 6,971
Posts: 2,053
Join Date: Jul 2012
Location: Lyon, France

 
DONATE TO ME
Quote:
Originally Posted by Poesini View Post
I am using Omni 3/15 lol
I made some changes to the GPU frequency table to try and fix that for next build, although I really don't see what caused this on your device.
Please report back after next build if the issue persists.

Let's take this discussion back to the kernel thread though, please.

Quote:
My Contributions
(Apps, Librairies, Roms & Guides)
 

Pimp My Rom: Website / App / Thread

dSploit: Website / Github

Flash Gordon (Flash zips without a recovery): Thread

Universal init.d: App

PlayView/CardsUI Library: Portal / Github

HoloGraph Library: Portal / Github

Ubuntu Touch for i9300: Thread

Omni nightlies for Xperia Z1: Thread

Paranoid Android builds: Thread

Revive your bricked p68xx : Guide
Follow me on Github
 
dbolivar
Old
#10  
Senior Member
Thanks Meter 310
Posts: 272
Join Date: Nov 2012
Location: Sao Paulo, Brazil
Very thorough analysis, thanks! Just suggested it to be featured on the XDA Portal.

The Following User Says Thank You to dbolivar For This Useful Post: [ Click to Expand ]
Tags
benchmarks, ext4, f2fs, f2fs vs ext4, i/o
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes