Skip to content
Commit 9ffdfa0c authored by Brad Fitzpatrick's avatar Brad Fitzpatrick
Browse files

Speed up ContentProvider.query() in simple case by ~30%

When query() uses bulkQuery() and we know we're going to need some
metadata right afterwards (number of rows and column index of _id, if
present), just asked for it in the initial binder transaction instead
of immediately fetching it again.

Also, this defers loading column names until the client asks for them.

This gets down the simpler (and very common) use cases of
ContentProvider.query() down to 3 binder calls:

   QUERY_TRANSACTION to android.content.ContentProvider$Transport
   GET_CURSOR_WINDOW_TRANSACTION to android.database.CursorToBulkCursorAdaptor
   CLOSE_TRANSACTION to android.database.CursorToBulkCursorAdaptor

More can still be done, but this is a good bite-sized first piece.

Change-Id: I7ad45949f53e0097ff18c2478d659f0f36929693
parent 33d1fdd6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment