Benchmark App to compare different storage libraries (MMKV, AsyncStorage, WatermelonDB, RealmDB, SQLite)

Overview

Storage Benchmarks

This is a benchmark app to compare popular storage solutions for React Native.

It's running React Native 0.68, with Hermes enabled.

The Benchmark consists of calling a get operation (retrieve one value from the database) a thousand times.

Here are the results, ranked from fastest to slowest:

  1. react-native-mmkv: 12ms 👑
  2. WatermelonDB: 53ms
  3. RealmDB: 81ms
  4. react-native-quick-sqlite: 82ms
  5. AsyncStorage: 242ms

MMKV is 20x faster than AsyncStorage (slowest), and 4x faster than WatermelonDB (second fastest)!

Output in the console:

Tested on an iPhone 11 Pro, Hermes, Debug

Run it

  1. Clone the repo and navigate to the app/ directory
  2. Run yarn
  3. Run yarn pods
  4. Run yarn ios --device "YOURPHONENAME"

You can also omit the --device "YOURPHONENAME" flag, but running on a Simulator always gives different results than on an actual device.

JS Engine

The benchmark project currently uses Hermes. To benchmark using JSC instead, set enable_hermes to false in the Podfile.

Hardware

The above results were tested on an iPhone 11 Pro. Results may differ on different iPhones or Android Phones.

Debug

The above results were tested in a debug build. Release mode builds come with many optimizations and are therefore faster than debug.

Operations

The above results were tested using get operations for a single string key (value: 'hello'). Results may differ when using other operations, such as set, delete, update, and more.

You might also like...

A Slimefun4 addon that adds a new storage solution for mass and organised storage without harsh performance.

A Slimefun4 addon that adds a new storage solution for mass and organised storage without harsh performance.

Networks is a Slimefun4 addon that brings a simple yet powerful item storage and movement network that works along side cargo. Network Grid / Crafting

Jan 7, 2023

Compare JSON in your Unit Tests

JsonUnit JsonUnit is a library that simplifies JSON comparison in tests. APIs AssertJ integration Hamcrest matchers Spring MVC assertions Spring WebTe

Dec 29, 2022

A mod to compare a seed's terrain to the current terrain

SeedMapper In-game Minecraft mod that allows you to compare natural terrain to your current terrain. For questions please go to my Discord. Disclaimer

Dec 22, 2022

Light Chinese Bible is a Mobile app created by Android and SQLite.

About Light Chinese Bible Light Chinese Bible is a Mobile app created by Android and SQLite. It allows you to read the bible on your phone or devices

Feb 10, 2022

Find different kinds of algorithm questions and solutions in different software languages

Find different kinds of algorithm questions and solutions in different software languages

Algorithm Samples ⭐ Find this project useful? If you think it has helped you, you can star this repo and join the Stargazers and motivate us to share

Oct 31, 2022

Application to benchmark block reading from bitcoind

BlockReader BlockReader is a small command line application to benchmark block reading performance. Currently, it is using bitcoin-cli to read blocks

Jan 18, 2022

Benchmark testing number reading/writing in Java.

double-reader-writer Benchmark testing number reading/writing in Java. Relates to FasterXML/jackson-core#577 So far, FastDoubleParser looks useful if

Apr 12, 2022

Tabletop Games Framework (TAG) - a Java-based benchmark for developing modern board games for AI research

Tabletop Games Framework (TAG) - a Java-based benchmark for developing modern board games for AI research

The Tabletop Games Framework (TAG) is a Java-based benchmark for developing modern board games for AI research

Dec 12, 2022

Aix-bench, the Java benchmark for code synthesis problem.

AiXcoder NL2Code Evaluation Benchmark (aix-bench) 简体中文 Paper available: https://arxiv.org/abs/2206.13179 Introduction This is a method-level benchmark

Dec 12, 2022

Realm is a mobile database: a replacement for SQLite & ORMs

Realm is a mobile database that runs directly inside phones, tablets or wearables. This repository holds the source code for the Java version of Realm

Jan 5, 2023

greenDAO is a light & fast ORM solution for Android that maps objects to SQLite databases.

greenDAO is a light & fast ORM solution for Android that maps objects to SQLite databases.

Check out ObjectBox Check out our new mobile database ObjectBox (GitHub repo). ObjectBox is a superfast object-oriented database with strong relation

Jan 5, 2023

CafeApp With SQLite

CafeApp With SQLite

CafeApp With SQLite Muhamad Taopik (1197050081) Untuk memenuhi syarat salah satu tugas ujian akhir semester mata kuliah Praktikum Pengembangan Aplikas

Jul 30, 2022

Aplicación Java tipo Ant con conexión a BD SQLite y CRUD.

CRUD-Java-Netbeans-TDEA Aplicación Java tipo Ant con conexión a BD SQLite y CRUD. Este proyecto es para el curso Desarrollo de Software 2 en el Tecnol

Dec 16, 2022

Tags plugin with MySQL, MariaDB & SQLite support

zAngelTags Support if you have any trouble you can visit my discord and ask any type of question about my plugins Building If you want to build the pl

Jul 26, 2022

It is a Basic Comment App for different users.

It is a Basic Comment App for different users.

Zoho-comments It is a Basic Comment App for different users. Technology Used : JAVA Swing, Mysql. Tools Used : Eclipse , WampServer. Mysql Table : sig

Feb 12, 2022

With react-native-update-in-app library you can easily implement in-app updates in your React Native app using CDN or any other file server

React Native In-App update With react-native-update-in-app library you can easily implement in-app updates in your React Native app using CDN or any o

Dec 21, 2022

Apache ORC - the smallest, fastest columnar storage for Hadoop workloads

Apache ORC ORC is a self-describing type-aware columnar file format designed for Hadoop workloads. It is optimized for large streaming reads, but with

Jan 2, 2023

MapDB provides concurrent Maps, Sets and Queues backed by disk storage or off-heap-memory. It is a fast and easy to use embedded Java database engine.

MapDB: database engine MapDB combines embedded database engine and Java collections. It is free under Apache 2 license. MapDB is flexible and can be u

Dec 30, 2022

An extremely easy way to perform background processing in Java. Backed by persistent storage. Open and free for commercial use.

An extremely easy way to perform background processing in Java. Backed by persistent storage. Open and free for commercial use.

The ultimate library to perform background processing on the JVM. Dead simple API. Extensible. Reliable. Distributed and backed by persistent storage.

Jan 6, 2023
Comments
  • Problem running on android

    Problem running on android

    Hi @mrousavy , I tried to run the app on a physical android device but I am failing to compile, I get the following errors:

    yarn run v1.22.4
    $ react-native run-android
    info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
    Jetifier found 973 file(s) to forward-jetify. Using 8 workers...
    info JS server already running.
    info Installing the app...
    
    > Configure project :react-native-mmkv
    MMKV: node_modules/ found at: /Users/Username/Desktop/StorageBenchmark/app/node_modules
    WARNING:DSL element 'dexOptions' is obsolete and should be removed.
    It will be removed in version 8.0 of the Android Gradle plugin.
    Using it has no effect, and the AndroidGradle plugin optimizes dexing automatically.
    
    > Configure project :react-native-quick-sqlite
    react-native-quick-sqlite: node_modules/ found at: /Users/Username/Desktop/StorageBenchmark/app/node_modules
    
    Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
    
    You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
    
    See https://docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings
    6 actionable tasks: 6 up-to-date
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    The Android Gradle plugin supports only Kotlin Gradle plugin version 1.3.40 and higher.
    The following dependencies do not satisfy the required version:
    project ':@nozbe_watermelondb' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.21
    
    * Try:
    > Run with --stacktrace option to get the stack trace.
    > Run with --info or --debug option to get more log output.
    > Run with --scan to get full insights.
    
    * Get more help at https://help.gradle.org
    
    BUILD FAILED in 5s
    
    error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
    Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    The Android Gradle plugin supports only Kotlin Gradle plugin version 1.3.40 and higher.
    The following dependencies do not satisfy the required version:
    project ':@nozbe_watermelondb' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.21
    
    * Try:
    > Run with --stacktrace option to get the stack trace.
    > Run with --info or --debug option to get more log output.
    > Run with --scan to get full insights.
    
    * Get more help at https://help.gradle.org
    
    BUILD FAILED in 5s
    
        at makeError (/Users/Username/Desktop/StorageBenchmark/app/node_modules/execa/index.js:174:9)
        at /Users/Username/Desktop/StorageBenchmark/app/node_modules/execa/index.js:278:16
        at processTicksAndRejections (node:internal/process/task_queues:96:5)
        at async runOnAllDevices (/Users/Username/Desktop/StorageBenchmark/app/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:109:5)
        at async Command.handleAction (/Users/Username/Desktop/StorageBenchmark/app/node_modules/@react-native-community/cli/build/index.js:192:9)
    info Run CLI with --verbose flag for more details.
    error Command failed with exit code 1.
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
    

    I did the linking of the modules on android, but I can't solve the problem.

    Have you had similar problems too?

    Schermata 2022-05-23 alle 14 22 02 Schermata 2022-05-23 alle 14 22 11 Schermata 2022-05-23 alle 14 22 20 Schermata 2022-05-23 alle 14 22 59
    opened by Angelk90 4
  • feat: add MMKV with encryption benchmark

    feat: add MMKV with encryption benchmark

    1. Added benchmark for encrypted MMKV storage - I run benchmark few times and it seems there was no statistically significant difference between encryption on/off.
    2. Updated storage libs to latest versions (it also solved some kind of runtime crash for Realm)

    I had to use iOS simulator, but I run benchmark multiple times and it gives very similar results everytime, but would be better to run on some real device, but I don't have any available right now.

    Screenshot 2022-09-16 at 15 57 41

    opened by Nodonisko 1
  • Graph in app

    Graph in app

    Hi @mrousavy , it would be nice to be able to view a graph within the app at the end of the test.

    As in the picture, what do you think?

    Screenshot_20220524-132325~2.png

    Also I thought it would be useful:

    1. That such a thing is printed on the console, the ranking from the one with the best times to the worst.
    Schermata 2022-05-24 alle 12 45 29
    1. As you can see in the image, an input field that allows you to vary the number of iterations without having to touch the code.

    2. Something like this would have been nice: https://twitter.com/i/status/1524378106039050240 Project: https://github.com/bamlab/react-native-performance

    opened by Angelk90 0
Owner
Marc Rousavy
they call me ranch cause i be dressing
Marc Rousavy
Realm is a mobile database: a replacement for SQLite & ORMs

Realm is a mobile database that runs directly inside phones, tablets or wearables. This repository holds the source code for the Java version of Realm

Realm 11.4k Jan 5, 2023
MapDB provides concurrent Maps, Sets and Queues backed by disk storage or off-heap-memory. It is a fast and easy to use embedded Java database engine.

MapDB: database engine MapDB combines embedded database engine and Java collections. It is free under Apache 2 license. MapDB is flexible and can be u

Jan Kotek 4.6k Dec 30, 2022
MapDB provides concurrent Maps, Sets and Queues backed by disk storage or off-heap-memory. It is a fast and easy to use embedded Java database engine.

MapDB: database engine MapDB combines embedded database engine and Java collections. It is free under Apache 2 license. MapDB is flexible and can be u

Jan Kotek 4.6k Jan 1, 2023
Clickhouse storage backend for Janusgraph

Clickhouse storage backend for Janusgraph Overview Clickhouse implementation of Janusgraph storage backend. Features New version 0.6.1 of JanusGraph c

null 3 Nov 30, 2022
A simple-to-use storage ORM supporting several databases for Java.

Storage Handler This is a library based off of my old storage handler within my queue revamp. It's for easy storage handling for multiple platforms. N

NV6 7 Jun 22, 2022
Android app for Ribbit, Broker API Reference App

Ribbit Reference Implementation (Android) The reference implementation for designing the Android user interface of a broker-dealer trading application

Alpaca 12 Nov 24, 2022
Sample Android App for WebRTC with Firebase as backend

Android WebRTC Firebase Simple Demo App for Android WebRTC video call using Firebase Realtime Database as Signalling server. Prerequisites Firebase Ac

Devesh Chaudhari 19 Dec 17, 2022
Opencode'21 Collaborative App !

Collaborative App The Official Android Application of OpenCode'21. About Us OpenCode is a month long open source program organised by GeekHaven IIIT A

OpenCode IIIT Allahabad 70 Dec 22, 2022
SceneView is a 3D/AR Android View with ARCore and Google Filament. This is the newest way to make your Android 3D/AR app.

SceneView is a 3D/AR Android View with ARCore and Google Filament This is Sceneform replacement Features Use SceneView for 3D only or ArSceneView for

SceneView Open Community 235 Jan 4, 2023