Does LruCache in android give you a significant performance difference against sqlite? -


i have application uses sqlite database present data movies user. each movie record in database contains strings , integers.

every time activity re-created, database queried necessary "movies".

my question following:

if create lrucache when app launched avoid querying database each time, there performance improvement? "significant"?

although lrucache can cache anything, thought helpful bitmap caching, bitmaps quite memory intensive. there other situations in can provide significant performance improvement?

sorry ignorance, know tool for.

thanks!

lrucaches useful when need cache number of things- example bitmaps create cache of fixed size cache 100mb of images, , else fails. allows avoid oom issues (please note lrucache isn't magical, still have code app use correctly advantage). cost of you'll preallocate most/all of cache before needed.

if have total memory used isn't 10s-100s of mb, you're better off using map instead. quicker , easier.

as lrucache or map vs sqlite- yes, quicker. if have anti-pattern querying database every getview in list, should avoid that. if you're querying eveything front , saving elsewhere in application, repeating query again major things new activity/fragment unlikely high cost. remember lrucache not persistent- need recreated scratch next time app launched. if need track changes or trying minimize server queries local db better.


Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -