Skip to content
This repository has been archived by the owner on Sep 25, 2023. It is now read-only.

Test suite for Orma (v0.6.0) #1

Merged
merged 2 commits into from
Nov 24, 2015
Merged

Test suite for Orma (v0.6.0) #1

merged 2 commits into from
Nov 24, 2015

Conversation

gfx
Copy link
Contributor

@gfx gfx commented Nov 22, 2015

Orma を追加しました。

OrmaTest.java が妥当かどうかご確認ください。

なお手元のNexus 9 (Marshmallow) で2回実行すると↓のようになりました。

adb logcat -t 1000 | ag OrmaTest: | perl -p -E 's/^.*OrmaTest: //'
Insert on ORMA (BulkMode:ON): begin
Insert on ORMA (BulkMode:ON):      270 ms, Insert 10000 records.
Insert on ORMA (BulkMode:ON):      48 ms, Select Records.
Insert on ORMA (BulkMode:ON): end, 318 ms
Insert on ORMA (BulkMode:OFF): begin
Insert on ORMA (BulkMode:OFF):      8440 ms, Insert 10000 records.
Insert on ORMA (BulkMode:OFF):      42 ms, Select Records.
Insert on ORMA (BulkMode:OFF): end, 8482 ms
Insert on ORMA (BulkMode:ON): begin
Insert on ORMA (BulkMode:ON):      255 ms, Insert 10000 records.
Insert on ORMA (BulkMode:ON):      42 ms, Select Records.
Insert on ORMA (BulkMode:ON): end, 297 ms
Insert on ORMA (BulkMode:OFF): begin
Insert on ORMA (BulkMode:OFF):      11062 ms, Insert 10000 records.
Insert on ORMA (BulkMode:OFF):      40 ms, Select Records.
Insert on ORMA (BulkMode:OFF): end, 11102 ms

同じ端末でのRealm (v0.84.2)の結果は↓です。

adb logcat -t 1000 | ag RealmTest: | perl -p -E 's/^.*RealmTest: //'
Insert on REALM (BulkMode:ON): begin
Insert on REALM (BulkMode:ON):      346 ms, Insert 10000 records.
Insert on REALM (BulkMode:ON):      4 ms, Select Records.
Insert on REALM (BulkMode:ON):      38 ms, Manual Import!: Select Records.
Insert on REALM (BulkMode:ON): end, 388 ms
Insert on REALM (BulkMode:OFF): begin
Insert on REALM (BulkMode:OFF):      56026 ms, Insert 10000 records.
Insert on REALM (BulkMode:OFF):      3 ms, Select Records.
Insert on REALM (BulkMode:OFF):      30 ms, Manual Import!: Select Records.
Insert on REALM (BulkMode:OFF): end, 56059 ms
Insert on REALM (BulkMode:ON): begin
Insert on REALM (BulkMode:ON):      318 ms, Insert 10000 records.
Insert on REALM (BulkMode:ON):      2 ms, Select Records.
Insert on REALM (BulkMode:ON):      31 ms, Manual Import!: Select Records.
Insert on REALM (BulkMode:ON): end, 351 ms
Insert on REALM (BulkMode:OFF): begin
Insert on REALM (BulkMode:OFF):      57327 ms, Insert 10000 records.
Insert on REALM (BulkMode:OFF):      1 ms, Select Records.
Insert on REALM (BulkMode:OFF):      27 ms, Manual Import!: Select Records.
Insert on REALM (BulkMode:OFF): end, 57355 ms

ところで、Realmは findAll() -> RealmResults<T> を行った時点ではクエリを発行しないようです。RealmResultsから値を取り出そうとして初めてクエリを発行するようですね。なので、manual importまでしてはじめて等価のオペレーションといってよさそうです。

Realmが爆速といわれるのは案外ベンチマークコードの間違いで、現状(v0.8x)だと最適化されたSQLiteベースのORMと実は大差ないという可能性がありますね。

@gfx gfx changed the title Test suite for Orma (v0.5.0) Test suite for Orma (v0.6.0) Nov 23, 2015
@keima
Copy link
Owner

keima commented Nov 24, 2015

LGTM
ありがとうございます!

「ところで」の件ですが、昨年にデータ計測をしたときにも少し気づいていたのですが、
集計に反映させることができていなかったので今年はそのあたりも確認したいです

keima added a commit that referenced this pull request Nov 24, 2015
Test suite for Orma (v0.6.0)
@keima keima merged commit b7d0d8e into keima:master Nov 24, 2015
@gfx gfx deleted the orma branch November 24, 2015 05:35
@gfx
Copy link
Contributor Author

gfx commented Nov 24, 2015

Thanks! 2016年版楽しみにしております。

@gfx gfx mentioned this pull request Nov 29, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants