Implementation

The Storage test consists of two parts:

  • File IO performance
  • Android SQLite performance 

File IO performance

In the File IO part, the test reads and writes files from and to the device’s internal and external storage systems. The test performs both serial and random accesses with selected block sizes. 

The data that is being read and written consists of random number characters. Before the read operations, the data is generated in the target partition by the application. 

For each access pattern, the test is repeated 5 times, and the median bandwidth is used in the result calculation. The final result describes throughput measured in MB/s. 

The implementation uses native code. The flags used when opening each file are O_RDWR|O_CREAT|O_DIRECT. 

For the write operations, a call to fsync() follows each write. 

Android SQL performance

In the Database part of the benchmark, the test performs a series of transactions for reading, updating, inserting, and deleting records in an SQLite database. 

The reading part of the test reads 10 sets of 600 records, 6000 records in total. The update, insert, and delete parts use 2,000 records. For each kind of operation, the bandwidth is used in the result calculation, given in IOPS (Input/Output Operations Per Second).

Workloads

Internal storage workloads

  1. Read a 32 MB file sequentially in 2 MB blocks from internal storage 
  2. Read a 32 MB file randomly in 4 KB blocks from internal storage 
  3. Write a 16 MB file sequentially in 2 MB blocks to internal storage 
  4. Write a 16 MB file randomly in 4 KB blocks to internal storage

External storage workloads

  1. Read a 32 MB file sequentially in 2 MB blocks from external storage 
  2. Read a 32 MB file randomly in 4 KB blocks from external storage 
  3. Write a 16 MB file sequentially in 2 MB blocks to external storage 
  4. Write a 16 MB file randomly in 4 KB blocks to external storage 

Database workloads

  1. Read 10 sets of 600 records from an SQLite database table
  2. Update 2000 records in an SQLite database table
  3. Insert 2000 records into an SQLite database table
  4. Delete 2000 records from an SQLite database table