Performance of multiple Memory stores on single page

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Performance of multiple Memory stores on single page


I've got some performance/memory questions related to dojo/store/Memory, and subsequently to dojo/store/Observable.   Let me give you the background first.  (Sorry in advance for the length!)

/*** background start */
Part of my application consists of a simple Facebook-like messaging area.  Members can post a comment, and other members can reply, "like", follow/unfollow, etc.  Replies are currently limited to the original post - i.e. you can't reply to a reply.

I've built 3 nested widgets to manage everything:

my/message/Messages :: one instance on page
     - my/message/Message: one instance per message within Messages instance
           - my/message/MessageReply :: one instance per reply within Message instance

The Messages widgets uses an Observable::Memory store to manage each Message.  Any changes to the underlying memory store (additions, deletes and updates) are reflected in it's the Message instance it supports - the "includeObjectUpdates" attribute is set to TRUE in the observe handle.  It works beautifully for automatically rendering new posts, removing deleted posts, and updating DOM nodes in the Message instance via custom _setters.  Performance is excellent.  I even setup a SSE engine to push changes down to the client when anything's changed.
/*** background end */

The Rub: Logically, I would use an Observable::Memory store within each Message widget to handle adds/removes/updates to message replies, identically to the way I'm handling it within the root Messages widget.  I've not done that, however, as I don't know if there would be any memory-related performance issues.  Instead, I'm handling changes in the MessageReply widgets manually using custom setters.  It's not as nifty as the Observable::Memory store that I'm using to manage each Message widget, but it works.

Should I be concerned about memory issues using so many Observable::Memory stores on a single page?  There could be 50 or a 100, for all I know (though their only pulling down 6 messages when they load the page, and can retrieve 6 more at a time when they hit the bottom of the page).

One of my concerns in using a stores to manage replies is that when a user deletes a message, I remove the item from the messages store, which in turn does a [message].destroyRecursive() on its accompanying Message widget.  But ... since there are no destroy() methods for stores, that store's just going to hang around.  It's fine at the Messages level, as there will ever only be one Messages store per page.


Dojo Toolkit:

[hidden email]
To unsubscribe, visit: