Overhead of insert notifications #15
Comments
It is a rather old piece of code written as I remember with transactions in mind. Could probably be updated for the better |
We should probably assign performance testing on the different methods of insertion. |
I definitely recommend using native |
Definitely something we have to look into. 👍 |
I think that moving to native |
yes but upsert is also slow. We should give abilities to insert in different ways. Even to an extreme of getting the DB from contentproviderclient and using the fastest bind method. |
but for that I rather be pragmatic and have the setup to test the performances. |
Another workaround would be to queue and squash the notifications which are sent because of the iteration. |
regardless of any performance improvements bulkInsert should only notify content observers once. |
This should definitely be looked into but I can see some reasoning to have it notified in a rather 'frequent' way. Data set change should not have knowledge about implementation of the insert/update. For instance, if we have a 10min write, you could be interested in updating the UI while the insert happens. Now it s either the activity or the content provider that would be responsible for this. Lets start by doing just one notify URI per bulk insert and then potentially adapt. We could do so by appending the params to the URI. i.e. content://test.com/table?withNotifyEvery=10 |
like that idea |
Closing as this repository is no longer under maintenance and it's about to be archived |
I noticed that multiple notifications are sent when
bulkInsert
is used. I figured out this because you iterating eachContentValue
and run an individual transactioninsert
on the item.I cannot see the reason why you are using
insert
in favor ofbulkInsert
. Could you please clarify?The text was updated successfully, but these errors were encountered: