Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

- added MMKV benchmark #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"path_provider","path":"/Users/misir/Workspace/tools/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.2/","dependencies":[]},{"name":"shared_preferences","path":"/Users/misir/Workspace/tools/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-2.0.6/","dependencies":[]},{"name":"sqflite","path":"/Users/misir/Workspace/tools/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-2.0.0+3/","dependencies":[]},{"name":"sqlite3_flutter_libs","path":"/Users/misir/Workspace/tools/flutter/.pub-cache/hosted/pub.dartlang.org/sqlite3_flutter_libs-0.5.0/","dependencies":[]}],"android":[{"name":"path_provider","path":"/Users/misir/Workspace/tools/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.2/","dependencies":[]},{"name":"shared_preferences","path":"/Users/misir/Workspace/tools/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-2.0.6/","dependencies":[]},{"name":"sqflite","path":"/Users/misir/Workspace/tools/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-2.0.0+3/","dependencies":[]},{"name":"sqlite3_flutter_libs","path":"/Users/misir/Workspace/tools/flutter/.pub-cache/hosted/pub.dartlang.org/sqlite3_flutter_libs-0.5.0/","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"/Users/misir/Workspace/tools/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-2.0.0/","dependencies":[]},{"name":"shared_preferences_macos","path":"/Users/misir/Workspace/tools/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-2.0.0/","dependencies":[]},{"name":"sqflite","path":"/Users/misir/Workspace/tools/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-2.0.0+3/","dependencies":[]},{"name":"sqlite3_flutter_libs","path":"/Users/misir/Workspace/tools/flutter/.pub-cache/hosted/pub.dartlang.org/sqlite3_flutter_libs-0.5.0/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/misir/Workspace/tools/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.0.0/","dependencies":[]},{"name":"shared_preferences_linux","path":"/Users/misir/Workspace/tools/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_linux-2.0.0/","dependencies":["path_provider_linux"]}],"windows":[{"name":"path_provider_windows","path":"/Users/misir/Workspace/tools/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.0.1/","dependencies":[]},{"name":"shared_preferences_windows","path":"/Users/misir/Workspace/tools/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_windows-2.0.0/","dependencies":["path_provider_windows"]}],"web":[{"name":"shared_preferences_web","path":"/Users/misir/Workspace/tools/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-2.0.0/","dependencies":[]}]},"dependencyGraph":[{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux","path_provider_windows"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_linux","shared_preferences_macos","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"sqflite","dependencies":[]},{"name":"sqlite3_flutter_libs","dependencies":[]}],"date_created":"2021-06-20 16:24:34.979554","version":"2.2.1"}
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"device_info_plus","path":"/Users/mopi/Development/flutter/.pub-cache/hosted/pub.dartlang.org/device_info_plus-4.1.3/","native_build":true,"dependencies":[]},{"name":"mmkv","path":"/Users/mopi/Development/flutter/.pub-cache/hosted/pub.dartlang.org/mmkv-1.2.15/","native_build":true,"dependencies":["device_info_plus"]},{"name":"path_provider_ios","path":"/Users/mopi/Development/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_ios-2.0.11/","native_build":true,"dependencies":[]},{"name":"shared_preferences_ios","path":"/Users/mopi/Development/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.1/","native_build":true,"dependencies":[]},{"name":"sqflite","path":"/Users/mopi/Development/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-2.2.2/","native_build":true,"dependencies":[]},{"name":"sqlite3_flutter_libs","path":"/Users/mopi/Development/flutter/.pub-cache/hosted/pub.dartlang.org/sqlite3_flutter_libs-0.5.12/","native_build":true,"dependencies":[]}],"android":[{"name":"device_info_plus","path":"/Users/mopi/Development/flutter/.pub-cache/hosted/pub.dartlang.org/device_info_plus-4.1.3/","native_build":true,"dependencies":[]},{"name":"mmkv","path":"/Users/mopi/Development/flutter/.pub-cache/hosted/pub.dartlang.org/mmkv-1.2.15/","native_build":true,"dependencies":["device_info_plus"]},{"name":"path_provider_android","path":"/Users/mopi/Development/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_android-2.0.22/","native_build":true,"dependencies":[]},{"name":"shared_preferences_android","path":"/Users/mopi/Development/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_android-2.0.14/","native_build":true,"dependencies":[]},{"name":"sqflite","path":"/Users/mopi/Development/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-2.2.2/","native_build":true,"dependencies":[]},{"name":"sqlite3_flutter_libs","path":"/Users/mopi/Development/flutter/.pub-cache/hosted/pub.dartlang.org/sqlite3_flutter_libs-0.5.12/","native_build":true,"dependencies":[]}],"macos":[{"name":"device_info_plus_macos","path":"/Users/mopi/Development/flutter/.pub-cache/hosted/pub.dartlang.org/device_info_plus_macos-3.0.0/","native_build":true,"dependencies":[]},{"name":"path_provider_macos","path":"/Users/mopi/Development/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-2.0.6/","native_build":true,"dependencies":[]},{"name":"shared_preferences_macos","path":"/Users/mopi/Development/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-2.0.5/","native_build":true,"dependencies":[]},{"name":"sqflite","path":"/Users/mopi/Development/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-2.2.2/","native_build":true,"dependencies":[]},{"name":"sqlite3_flutter_libs","path":"/Users/mopi/Development/flutter/.pub-cache/hosted/pub.dartlang.org/sqlite3_flutter_libs-0.5.12/","native_build":true,"dependencies":[]}],"linux":[{"name":"device_info_plus_linux","path":"/Users/mopi/Development/flutter/.pub-cache/hosted/pub.dartlang.org/device_info_plus_linux-3.0.0/","native_build":false,"dependencies":[]},{"name":"path_provider_linux","path":"/Users/mopi/Development/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.1.7/","native_build":false,"dependencies":[]},{"name":"shared_preferences_linux","path":"/Users/mopi/Development/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_linux-2.1.2/","native_build":false,"dependencies":["path_provider_linux"]},{"name":"sqlite3_flutter_libs","path":"/Users/mopi/Development/flutter/.pub-cache/hosted/pub.dartlang.org/sqlite3_flutter_libs-0.5.12/","native_build":true,"dependencies":[]}],"windows":[{"name":"device_info_plus_windows","path":"/Users/mopi/Development/flutter/.pub-cache/hosted/pub.dartlang.org/device_info_plus_windows-4.1.0/","native_build":false,"dependencies":[]},{"name":"path_provider_windows","path":"/Users/mopi/Development/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.1.3/","native_build":false,"dependencies":[]},{"name":"shared_preferences_windows","path":"/Users/mopi/Development/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_windows-2.1.2/","native_build":false,"dependencies":["path_provider_windows"]},{"name":"sqlite3_flutter_libs","path":"/Users/mopi/Development/flutter/.pub-cache/hosted/pub.dartlang.org/sqlite3_flutter_libs-0.5.12/","native_build":true,"dependencies":[]}],"web":[{"name":"device_info_plus_web","path":"/Users/mopi/Development/flutter/.pub-cache/hosted/pub.dartlang.org/device_info_plus_web-3.0.0/","dependencies":[]},{"name":"shared_preferences_web","path":"/Users/mopi/Development/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-2.0.4/","dependencies":[]}]},"dependencyGraph":[{"name":"device_info_plus","dependencies":["device_info_plus_macos","device_info_plus_linux","device_info_plus_web","device_info_plus_windows"]},{"name":"device_info_plus_linux","dependencies":[]},{"name":"device_info_plus_macos","dependencies":[]},{"name":"device_info_plus_web","dependencies":[]},{"name":"device_info_plus_windows","dependencies":[]},{"name":"mmkv","dependencies":["path_provider","device_info_plus"]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_ios","path_provider_linux","path_provider_macos","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_ios","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_ios","shared_preferences_linux","shared_preferences_macos","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_ios","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"sqflite","dependencies":[]},{"name":"sqlite3_flutter_libs","dependencies":[]}],"date_created":"2023-01-11 02:06:30.220695","version":"3.3.10"}
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,18 @@ A few resources to get you started if this is your first Flutter project:
For help getting started with Flutter, view our
[online documentation](https://flutter.dev/docs), which offers tutorials,
samples, guidance on mobile development, and a full API reference.

## Screenshots

Tests on Xiaomi Mi 10 (Android 12)


- Read operations
<img src="https://moati.com/git/hive_benchmark/hive_benchmark_read.jpg" width="270">
<img src="https://moati.com/git/hive_benchmark/hive_benchmark_read_precise.jpg" width="270">
- Write operations
<img src="https://moati.com/git/hive_benchmark/hive_benchmark_write.jpg" width="270">
<img src="https://moati.com/git/hive_benchmark/hive_benchmark_write_precise.jpg" width="270">
- Delete operations
<img src="https://moati.com/git/hive_benchmark/hive_benchmark_delete.jpg" width="270">
<img src="https://moati.com/git/hive_benchmark/hive_benchmark_delete_precise.jpg" width="270">
6 changes: 3 additions & 3 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 30
compileSdkVersion 33

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand All @@ -35,8 +35,8 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.hive_benchmark"
minSdkVersion 16
targetSdkVersion 30
minSdkVersion 21
targetSdkVersion 33
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
Expand Down
5 changes: 4 additions & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.hive_benchmark">
<application
android:label="hive_benchmark"
Expand All @@ -9,7 +10,9 @@
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
android:windowSoftInputMode="adjustResize"
android:exported="true"
tools:node="merge">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
Expand Down
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
buildscript {
ext.kotlin_version = '1.3.50'
ext.kotlin_version = '1.6.10'
repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath 'com.android.tools.build:gradle:4.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand Down
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip
2 changes: 1 addition & 1 deletion ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>8.0</string>
<string>11.0</string>
</dict>
</plist>
12 changes: 6 additions & 6 deletions ios/Flutter/flutter_export_environment.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=/Users/misir/Workspace/tools/flutter"
export "FLUTTER_APPLICATION_PATH=/Users/misir/Workspace/repos/github.com/hivedb/hive_benchmark"
export "FLUTTER_ROOT=/Users/mopi/Development/flutter"
export "FLUTTER_APPLICATION_PATH=/Users/mopi/Documents/PROJETS/PERSO/MCIB/mon-coach-ig-bas/src/v4-FLUTTER/libs/hive_benchmark"
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_TARGET=lib/main.dart"
export "FLUTTER_TARGET=/Users/mopi/Documents/PROJETS/PERSO/MCIB/mon-coach-ig-bas/src/v4-FLUTTER/libs/hive_benchmark/lib/main.dart"
export "FLUTTER_BUILD_DIR=build"
export "SYMROOT=${SOURCE_ROOT}/../build/ios"
export "FLUTTER_BUILD_NAME=1.0.0"
export "FLUTTER_BUILD_NUMBER=1"
export "DART_DEFINES=Zmx1dHRlci5pbnNwZWN0b3Iuc3RydWN0dXJlZEVycm9ycz10cnVl,RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ=="
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=false"
export "TRACK_WIDGET_CREATION=true"
export "TREE_SHAKE_ICONS=false"
export "PACKAGE_CONFIG=.packages"
export "PACKAGE_CONFIG=/Users/mopi/Documents/PROJETS/PERSO/MCIB/mon-coach-ig-bas/src/v4-FLUTTER/libs/hive_benchmark/.dart_tool/package_config.json"
23 changes: 22 additions & 1 deletion ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
platform :ios, '11.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand All @@ -10,6 +10,27 @@ project 'Runner', {
'Release' => :release,
}

def fix_mmkv_plugin_name(flutter_application_path)
is_module = false
plugin_deps_file = File.expand_path(File.join(flutter_application_path, '..', '.flutter-plugins-dependencies'))
if not File.exists?(plugin_deps_file)
is_module = true;
plugin_deps_file = File.expand_path(File.join(flutter_application_path, '.flutter-plugins-dependencies'))
end

plugin_deps = JSON.parse(File.read(plugin_deps_file)).dig('plugins', 'ios') || []
plugin_deps.each do |plugin|
if plugin['name'] == 'mmkv' || plugin['name'] == 'mmkvflutter'
require File.expand_path(File.join(plugin['path'], 'tool', 'mmkvpodhelper.rb'))
mmkv_fix_plugin_name(flutter_application_path, is_module)
return
end
end
raise "Fail to find any mmkv plugin dependencies. If you're running pod install manually, make sure flutter pub get is executed first"
end

fix_mmkv_plugin_name(File.dirname(File.realpath(__FILE__)))

def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
Expand Down
84 changes: 84 additions & 0 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
PODS:
- device_info_plus (0.0.1):
- Flutter
- Flutter (1.0.0)
- FMDB (2.7.5):
- FMDB/standard (= 2.7.5)
- FMDB/standard (2.7.5)
- MMKV (1.2.14):
- MMKVCore (~> 1.2.14)
- MMKVCore (1.2.14)
- mmkvflutter (1.2.14):
- Flutter
- MMKV (>= 1.2.14)
- path_provider_ios (0.0.1):
- Flutter
- shared_preferences_ios (0.0.1):
- Flutter
- sqflite (0.0.2):
- Flutter
- FMDB (>= 2.7.5)
- sqlite3 (3.40.0):
- sqlite3/common (= 3.40.0)
- sqlite3/common (3.40.0)
- sqlite3/fts5 (3.40.0):
- sqlite3/common
- sqlite3/perf-threadsafe (3.40.0):
- sqlite3/common
- sqlite3/rtree (3.40.0):
- sqlite3/common
- sqlite3_flutter_libs (0.0.1):
- Flutter
- sqlite3 (~> 3.40.0)
- sqlite3/fts5
- sqlite3/perf-threadsafe
- sqlite3/rtree

DEPENDENCIES:
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
- Flutter (from `Flutter`)
- mmkvflutter (from `.symlinks/plugins/mmkvflutter/ios`)
- path_provider_ios (from `.symlinks/plugins/path_provider_ios/ios`)
- shared_preferences_ios (from `.symlinks/plugins/shared_preferences_ios/ios`)
- sqflite (from `.symlinks/plugins/sqflite/ios`)
- sqlite3_flutter_libs (from `.symlinks/plugins/sqlite3_flutter_libs/ios`)

SPEC REPOS:
trunk:
- FMDB
- MMKV
- MMKVCore
- sqlite3

EXTERNAL SOURCES:
device_info_plus:
:path: ".symlinks/plugins/device_info_plus/ios"
Flutter:
:path: Flutter
mmkvflutter:
:path: ".symlinks/plugins/mmkvflutter/ios"
path_provider_ios:
:path: ".symlinks/plugins/path_provider_ios/ios"
shared_preferences_ios:
:path: ".symlinks/plugins/shared_preferences_ios/ios"
sqflite:
:path: ".symlinks/plugins/sqflite/ios"
sqlite3_flutter_libs:
:path: ".symlinks/plugins/sqlite3_flutter_libs/ios"

SPEC CHECKSUMS:
device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
MMKV: 9c4663aa7ca255d478ff10f2f5cb7d17c1651ccd
MMKVCore: 89f5c8a66bba2dcd551779dea4d412eeec8ff5bb
mmkvflutter: 325713a470a4015625dfd829070745c5ca852df6
path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02
shared_preferences_ios: 548a61f8053b9b8a49ac19c1ffbc8b92c50d68ad
sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904
sqlite3: 88dd99ef4ac3945f5a15facdd752933c52fd93bf
sqlite3_flutter_libs: c00751e981228acb63595236703da79d31282b63

PODFILE CHECKSUM: 1ea2175ad83c35b73624e94ae453d66e657b2653

COCOAPODS: 1.11.3
Loading