Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android ContentProvider Performance

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?

like image 453
satur9nine Avatar asked Dec 13 '10 07:12

satur9nine


1 Answers

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.

like image 170
Fernwilter Avatar answered Oct 15 '22 12:10

Fernwilter