AndroidDatabaseLibraryComparison
AndroidDatabaseLibraryComparison copied to clipboard
Update Realm code
-
It doesn't make sense to iterate through all address books to call insert methods for contacts and address items as when you call
realm.insertOrUpdate(finalAddressBooks), all contacts and addresses referenced are also inserted. This is similar to DBFlowTester calling onlySaver.saveAll(finalAddressBooks), without needing to call this same method for contacts and address items. -
Call
insertOrUpdate()instead ofcopyToRealm(), as we are concerned only about inserting these entities, and not retrieving the newly inserted items.insertOrUpdate()doesn't return the inserted entites, and as stated in the docs, this makes it run faster. -
Update Realm version.