## 4 Experiment
### New Features  
Mobibench provides eight different synchronization options and can vary the number of threads. These features allow us to effectively tailor the benchmark workload for the target environment. We performed three different experiments in file I/O, SQLite, and multithreading degree. We examined the performance of 4 KByte random write() followed by fsync(). We varied journal and synchronization modes of SQLite and ran experiments on multithreading environment. We used the same devices and partitions as the previous section. Figure 8: SQLite insert and update performance on twelve smartphone models from different smartphone manufacturers. (**a**) Insert; (**b**) Update. SQLite journal mode: TURNCATE. GP: LG Optimus Pro, G2: LG Optimus G2; HO: HTC ONE; GS4: Samsung Galaxy S4; GS3: Samsung Galaxy S3; GN2: Samsung Galaxy Note2; VR3: Pantech Vega R3; Ne7: Google Nexus 7; GNe: Samsung Galaxy Nexus; GS2: Samsung Galaxy S2; GN: Samsung Galaxy Note; Subscript i and j denote the versions of Android: Ice Ceram Sandwich (4.0.4) and Jelly Bean (4.2.x, 4.3.x), respectively. (/data partition, EXT4). Figure 9 compares the results of write()+ fsync() against synchronous and direct write using file and I/O size of 512 MB and 4 KB, respectively. write()+ fsync() and synchronous write show similar performances on sequential workload. With random write workload, on the contrary, the number of I/Os caused by textttsync() is increased. As a result, the performance of write()+ fsync() is about twice as slower than that of synchronous write. Figure 10 shows the performances of write()+ fsync() under varying number of threads. Note that all threads, which have equal file size, in an experiment sums up to the file size of 512 MB. As the number of threads increases, the performance also increases because Galaxy S4 is equipped with octa-core CPU; however, when there are more than 16 threads, the performance saturates because all H/W resources are exploited. Mobibench offers an option to change SQLite journal and sync mode. There are six journal modes in SQLite: DELETE, TRUNCATE, PERSIST, WAL, MEM, and OFF. Excluding MEM and OFF journal modes, SQLite suggests that WAL journal mode shows the best performance [29]. In MEMORY mode, SQLite stores the journal information in system memory. OFF mode does not keep account of the journal. Figure 11 shows the results of average TPS of running 10,000 insert, update, and delete operations. Insert in WAL mode shows about 4 times better performance than in other journal modes. On the other hand, update in WAL mode shows slightly lower performance than in the other modes. Main reason behind this result is modified SQLite library in Galaxy S4. The manufacturer modified the library to use OFF mode in update operations on DELETE, TRUNCATE, and PERSISTENT modes. Using strace, we have verified that all except WAL mode operate like OFF mode in update operations. Figure 10: write()+ fsync() with multi-thread, I/O on internal eMMC. Filesize: 512 MB; I/O-size: 4 KB [Samsung Galaxy S4, Android 4.2.2 (JB), /data partition, EXT4]. Figure 9: write()+fsync(), I/O on internal eMMC. Filesize: 512 MB; I/O-size: 4 KB [Samsung Galaxy S4, Android 4.2.2 (JB), /data partition, EXT4]. Another mode that has noteworthy effect on performance of SQLite is sync mode. There are three sync modes in SQLite: FULL, NORMAL, and OFF. The number of times SQLite calls fsync() is determined by the mode. FULL mode calls fsync() on each transaction to guarantee that all the data is written to a storage device. NORMAL mode still calls fsync() at the most critical point, but less often than FULL mode. OFF mode does not call fsync() while processing a transaction. Figure 12 illustrates the results of three sync modes while running insert, update, and delete SQLite operations. It shows that using OFF mode speeds up the transactions greatly compared to NORMAL or FULL modes in all SQLite operations. Mobibench also supports multi-threading. Figure 13 illustrates the effect of increasing the number of threads up to 32.