During my profile report of assembleDebug
gradle task I discovered two realm related gradle sub-tasks which takes quite big amount of time:
assembleDebug - 1m21.44s
- transformClassesWithRealmOptionalAPITransformerForDebug - 22.386s
- transformClassesWithRealmTransformerForIdeDebug - 10.062s
Questions:
Update
As a workaround I am skipping task via -x
script parameter
assembleDebug -x transformClassesWithRealmOptionalAPITransformerForDebug
transformClassesWithRealmOptionalAPITransformerForDebug
is created for removing RxJava
related APIs since it might create troubles for some cases (cases which need reflection like https://realm.io/docs/java/latest/#jackson-databind) which doesn't have the RxJava
dependency. But we found it doesn't play well in some occasions like https://github.com/realm/realm-java/issues/3033 and https://github.com/realm/realm-java/issues/3022 . So it will be disabled in the next release after v1.0.1
.
transformClassesWithRealmTransformerForIdeDebug
is the core part Realm relies on. Basically it replace the field access to the RealmObject
with Realm accessors by bytecode manipulating. You can see this post for a bit more details. Thus, this task cannot be skipped.
PS. an issue is created to track the transformer speed improvement.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With