I'm curious if anyone has done any performance testing on querying a ContentProvider
via ContentResolver
vs querying a SQLiteDatabase
object in the same process. I'm guessing that a ContentResolver
query passes back a Cursor that communicates with the database through a Binder (Android IPC). This means that if I read the contents of 100 records through the Cursor
that would result 100 Binder method calls. Are my guesses correct and if so would that be significantly slower than accessing the database in the same process?
I have not done exactly that meassure. What I did was to meassure the performance of multiple inserts via a ContentProvider or directly via a SQLite database. I inserted around 1000 items (one by one). It was much slower to insert via a ContentProvider. In my test almost 10% slower.
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