I'm building an Android app that tracks Mutual Fund performance. The app allows you to create a portfolio to add your funds.
This being a mutual fund app (and not a stock app), it fetches the updated fund "price" (Net Asset Value Per Share) once a day and recomputes the portfolio (Current Value, Current Yield [+/-]). This "refresh" operation is expensive as it consumes data and a lot of CPU cycles.
The portfolio XML only contains user-inputted "static" data:
- Funds in Portfolio
- Investments in Funds (How much Shares were bought and when)
All computed "dynamic" data are not persisted anywhere. The rationale is that those data change under different circumstances (Fetched updated fund price, Added new Investments, etc).
As a result, when the user launches the app, the app reads the static data from the XML file, read the latest FUND PRICES (from DB or Web Service) and then proceeds recompute everything. This takes a substantial amount of time.
Question:
In the brave new world of Mobile Development where people expects snappy app responses, is it a new "best" practice to cache dynamic data instead of recomputing it everytime that it is needed?
Should I cache the dynamic data to make certain operations smooth and fast or should I just recompute everytime?
Thanks!