PDA

View Full Version : Performance Question regarding the loading of many data stores



Trok1
5 Aug 2010, 6:16 AM
Hi all,

I'm new to EXTJS and really enjoying everything about it. The reward for learning this framework is priceless.

I have been struggling to decide how to handle the loading of many data stores. I am building a web site management system. A web page is a collection of assets (image, paragraph, list, etc.) Each asset has a dedicated table in the DB. So there are a total of 10 assets (10 DB tables) and unlimited pages. My question is whether I should load all asset tables into separate data store from the start (when the admin wants to work on the page-asset relationships) or should I just load the asset needed based on the page they selected.

Here are my concerns:
1. load when needed

a user may bounce around the listing of all their pages and this results in many calls to the server and time to retrieve and set the data stores

2. Load all asset data stores up front for all pages and work on retrieving the necessary info as the user clicks the different pages from the list view

this may use a lot of memory unnecessarily, as we would be loading info that may never even be used.
Any thoughts about this? Thank you ahead of time for your valuable feedback.

Best Wishes,

Todd

Condor
5 Aug 2010, 6:26 AM
It's obviously a trade-off: low memory usage/many server requests vs. high memory usage/single large server request.

I haven't seen many instances where preloading an entire dataset was useful though.

Trok1
5 Aug 2010, 7:21 AM
Thank Condor.

I decided to use Ext.util.DelayedTaskwhen a user selects a page.
This way if the user selects pages quickly it wont make the calls to the server. Hopefully this will work as planned. I just did a quick search in the api for delay and this came up.Thanks,

Todd