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

Test suite for Orma (v0.6.0) #1

Merged
merged 2 commits into from Nov 24, 2015

Conversation

Projects
None yet
2 participants
@gfx
Contributor

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 from Test suite for Orma (v0.5.0) to Test suite for Orma (v0.6.0) Nov 23, 2015

@keima

This comment has been minimized.

Owner

keima commented Nov 24, 2015

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

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

keima added a commit that referenced this pull request Nov 24, 2015

Merge pull request #1 from gfx/orma
Test suite for Orma (v0.6.0)

@keima keima merged commit b7d0d8e into keima:master Nov 24, 2015

@gfx gfx deleted the gfx:orma branch Nov 24, 2015

@gfx

This comment has been minimized.

Contributor

gfx commented Nov 24, 2015

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

@gfx gfx referenced this pull request Nov 29, 2015

Merged

use orma v0.8.0 #3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment