Saturday 15 September 2012

android - Caching versus Recomputing -



android - Caching versus Recomputing -

i'm building android app tracks mutual fund performance. app allows create portfolio add together funds.

this beingness mutual fund app (and not stock app), fetches updated fund "price" (net asset value per share) 1 time day , recomputes portfolio (current value, current yield [+/-]). "refresh" operation expensive consumes info , lot of cpu cycles.

the portfolio xml contains user-inputted "static" data:

funds in portfolio investments in funds (how much shares bought , when)

all computed "dynamic" info not persisted anywhere. rationale info alter under different circumstances (fetched updated fund price, added new investments, etc).

as result, when user launches app, app reads static info xml file, read latest fund prices (from db or web service) , proceeds recompute everything. takes substantial amount of time.

question:

in brave new world of mobile development people expects snappy app responses, new "best" practice cache dynamic info instead of recomputing everytime needed?

should cache dynamic info create operations smooth , fast or should recompute everytime?

thanks!

i prefer not caching until know necessary, because recomputing less error-prone. first performance tuning this technique on time-consuming phase of execution. think it's much easier performance tuning complexify programme caching, when i'm not positive help much.

but after performance tuning, , can see recomputing still major time-taker, yes, caching.

android performance caching mobile

No comments:

Post a Comment