[AT&T Samsung Galaxy S 4 General] FingerFoo:
#Built-in internal SD card cache speed testing (Not external SD card)

#512k 1024k 1536k 2048k 3072k 4096k

#GalaxyS4 I337M CarbonROM 4.4.4 (jfltecan/jflte)

Hello xda-developers community!

I've been reading and learning from a lot of you for a long time now. You are the best!

I was testing my SD card speed at different cache sizes keeping notes and decided to join and share all this with you.

I wanted to join already anyway. This was my excuse. :)

All tests were performed with the cpu governor set/locked to performance mode automatically at boot.

I did not use the device during all this testing and all tests were done under the same device conditions.

The device is fully charged and plugged into the wall at all times.

Auto-Rotate is off for all testing, and nothing is autorunning inconsistently in the background from boot to boot.

Exposed module 'Media Scanner Optimizer' to stop/limit auto media scanning after the initial boot scan.

Scripts were used to set the SD cache size automatically at boot, activating and deactivating

the appropriate script manually between each series of different SD cache size tests.

'A1 SD Bench' app was used to do the testing.

Accurate test

and

Random I/O test

SD cache size auto boot scripts were preferable to setting the cache sizes manually after each boot wihle testing

because the program 'A1 SD Bench' requires a reboot to complete each of these tests and SD cache size would revert to

stock android setting at each boot ruining the test without having to manually change the cache size to the current

test you're performing, mid test. Annoying, so scripts were used to set SD cache automatically at boot.

I set SD cache size and forget it for each of the different cache size series of tests before I would begin.

The reason for all this is:

Example: If you perform the program's regular long or quick tests one after another without a reboot you will notice it

pops up a warning message 'CACHE READ' after a while because without a reboot to clear cache in between the seperate

tests or during the accurate or random I/O test then you would be inaccurately reading from previous cached test content.

(Do not use 'Soft Reboot' method.)

This is why I feel this program 'A1 SD Bench' is superior to others at SD card speed testing. Other testing programs

would not mention 'CACHE READ' or the need to reboot to clear cache for accurate speed testing and just give you false

and inconsistent readings over and over as most other SD speed testing programs do.

Also, when the program's accurate or random I/O test requires a reboot to complete, upon reboot the program has a 150 second

wait period before you can continue/finalize the test so that android is properly fully booted and all media is loaded.

This makes each test far more consistent.

These are the scripts I used, placed in /system/etc/init.d folder: (??init.d folder may be at /etc/init.d for your device??)

If init.d folder is not present you can create it and place your scripts there with excecute bit permission to run at boot.

chmod 755 to scripts (rwxr-xr-x)

777 permission is not needed as we don't need/want world/other to have write permission to these script files.

You need to be root and have busybox to do any of this and mount / with read-write permission while modifying/creating.

su
mount -o remount,rw /

or

su
busybox mount -o remount,rw /

When done modifying/creating any of these files and/or directories, to remount / with read only permission do:

su
mount -o remount,ro /

or

su
busybox mount -o remount,ro /

If init.d is not activated at all on your device, which is very rare these days, you can use the free

app called 'Script Manager' to create the txt script files and set them to run at boot. Very good program!

(Program needs root access and busybox of course.)

Even when/if init.d is activated in your particular ROM, stock or otherwise, sometimes there will be no init.d

folder so first try creating it and placing your scripts there and see if things work/change properly on boot.

To check current SD cache size:

cat /sys/block/mmcblk0/queue/read_ahead_kb

To check current external SD card cache size:

cat /sys/block/mmcblk1/queue/read_ahead_kb

Only one script at a time should have the excecute bit set. Activate and deactivate different SD cache sizes as neccesary for

testing by setting the excecute bit on the script you want to have run automatically at boot. Remove excecute bit from others.

The first two digits of the filenames in init.d folder tell the system in which order to run any scripts in this directory.

EXAMPLE: 01tweaks file would run before 50tweaks

INFO: If 01tweaks file has the execute bit disabled, and 50tweaks file has the excecute bit enabled, then

01tweaks file would not be excecuted at boot at all, it moves down the list and 50tweaks would be run in order.

So if init.d is active on your device and the system has files in this directory, it is good practice to place a 99 before

your custom scripts to have them run last after the system loads everything else in the init.d folder.

(Script file names can be anything you like, this is just my file naming scheme for this testing.)

Script filename: 99_0512k

#!/system/bin/sh
echo "512" > /sys/block/mmcblk0/queue/read_ahead_kb

Script filename: 99_1024k

#!/system/bin/sh
echo "1024" > /sys/block/mmcblk0/queue/read_ahead_kb

Script filename: 99_1536k

#!/system/bin/sh
echo "1536" > /sys/block/mmcblk0/queue/read_ahead_kb

Script filename: 99_2048k

#!/system/bin/sh
echo "2048" > /sys/block/mmcblk0/queue/read_ahead_kb

Script filename: 99_3072k

#!/system/bin/sh
echo "3072" > /sys/block/mmcblk0/queue/read_ahead_kb

Script filename: 99_4096k

#!/system/bin/sh
echo "4096" > /sys/block/mmcblk0/queue/read_ahead_kb

(INFO: Change mmcblk0 to mmcblk1 for external SD card cache changing/testing.)

(NOTE: It is far simpler to use the app 'Script Manager' to make the SD card cache size changes and

to have a certain script set on boot and others disabled between each different cache size test.)

Format:

---------------

Test type

---------------

cache size in kilobytes

Read - Write

Read - Write

Read - Write

Read - Write

Read - Write

---------------

Average = adding up all test scores then dividing this number by how many tests were performed. 5 in this case.

Testing begins:

---------------

Accurate Test

---------------

512k

107.93 - 30.95

107.96 - 27.90

106.26 - 31.16

108.46 - 30.96

106.55 - 30.97

---------------

107.432 - 30.388 Average

1024k

109.51 - 31.20

106.81 - 30.43

109.29 - 30.86

107.08 - 31.79

107.39 - 31.98

---------------

108.016 - 31.252 Average

1536k

108.79 - 30.71

108.89 - 29.85

108.89 - 31.07

108.50 - 32.39

107.73 - 29.82

---------------

108.560 - 30.768 Average

2048k

107.97 - 31.05

108.46 - 30.56

108.78 - 31.45

108.71 - 30.00

108.76 - 31.35

---------------

108.536 - 30.882 Average

3072k

108.54 - 30.08

107.78 - 31.99

108.20 - 30.84

108.09 - 29.60

105.89 - 30.26

---------------

107.7 - 30.554 Average

4096k

107.76 - 30.64

109.76 - 30.63

108.03 - 31.87

108.94 - 30.34

108.13 - 31.11

---------------

108.524 - 30.918 Average

-------------------------

'Accurate test' results = ??1024k vs 4096k??

-------------------------

107.432 - 30.388 - 512k

108.016 - 31.252 - 1024k

108.560 - 30.768 - 1536k

108.536 - 30.882 - 2048k

107.700 - 30.554 - 3072k

108.524 - 30.918 - 4096k

-------------------------

Accurate testing complete.

-------------------------

---------------

Random I/O Test

---------------

512k

34.68 - 1.18

38.80 - 1.19

29.72 - 1.19

29.53 - 1.18

28.02 - 1.19

---------------

32.15 - 1.186 Average

1024k

34.53 - 1.19

53.30 - 1.19

49.37 - 1.15

40.72 - 1.19

38.55 - 1.19

---------------

43.294 - 1.182 Average

1536k

59.90 - 1.18

68.48 - 1.18

62.53 - 1.19

51.83 - 1.15

64.93 - 1.19

---------------

61.534 - 1.178 Average

2048k

75.25 - 1.20

59.90 - 1.19

64.96 - 1.19

68.98 - 1.15

67.30 - 1.14

---------------

67.278 - 1.174 Average

3072k

71.89 - 1.20

76.72 - 1.18

74.98 - 1.18

71.15 - 1.19

76.66 - 1.19

---------------

74.28 - 1.188 Average

4096k

73.77 - 1.22

122.54-1.18 - ??Read speed??

71.31 - 1.21

72.00 - 1.18

82.09 - 1.17

---------------

84.342 - 1.192 Average

-------------------------

'Random I/O test' results = ??4096k??

-------------------------

32.15 - 1.186 - 512k

43.294-1.182 - 1024k

61.534-1.178 - 1536k

67.278-1.174 - 2048k

74.28 - 1.188 - 3072k

84.342-1.192 - 4096k

-------------------------

Random I/O testing complete.

-------------------------

I will test again on another day and post and compare results. I have OCD. LoL

At first I thought to set the internal SD cache size to 1024k, but after running the random I/O tests, I changed my mind.

I set my S4's internal SD cache size to 4096.

What do you think?