-
September 28th, 2007, 02:09 PM
#1
Dynamic Content
If I want to modify the Stock List Demo to add or remove items from the UI, what are the options that I have? I see two.
1. On every add/delete of an item, unsubscribe the current table, change the contents of items array and subscribe again - In this approach, the problem is even for adding a new item, I end up unsubscribing and resubscribing for the other items in the table. This is a huge problem if the list that I ve is huge.
2. Create a new NonVisualTable for every item in my list and manually handle updating the data on the DataGrid. So everytime I add a new item, I ll create a new NonVisualTable and everytime I remove an item, I ll unsubscribe only that table - Again, the problem with this approach is when I create a huge list, I end up creating many nonVisualTables. When there are frequent updates for each of the item, the CPU usage and memory usage of the client goes high.
Is there any other cleaner approach that I can follow to acheive this?
- Venki
-
October 1st, 2007, 09:34 AM
#2
Hi,
I'm sorry but presently the 2 options shown are the only available.
I advice to use option number 2.
Originally Posted by
venkihere
When there are frequent updates for each of the item, the CPU usage and memory usage of the client goes high.
Do you mean that having five NonVisualTable with one item each updating the same grid is more expensive than having 1 VisualTable with five items?
-
October 1st, 2007, 02:08 PM
#3
Originally Posted by
Mone
Do you mean that having five NonVisualTable with one item each updating the same grid is more expensive than having 1 VisualTable with five items?
Yes.. I tried a page with about 25 nonVisualTables on my page with an average update rate of about 100 events per second per page. The CPU usage (IE alone) went above 90% and the page was using about 300 mb memory in about a couple of hours. I am not sure whether this behaviour is because of the number of nonVisualTables or the number of events.
-
October 1st, 2007, 02:14 PM
#4
Did you see that -on the same PC- using a VisualTable with the same number of item/fields/updates is much better?
How do you show new updates when you're using NonVisualTables?
-
October 3rd, 2007, 08:35 AM
#5
Originally Posted by
Mone
How do you show new updates when you're using NonVisualTables?
I have an ArrayCollection backing up my Datagrid as a data provider. On every NonVisualItemUpdateEvent, the even listener method will update the appropriate position in the data provider depending on what column has been changed. This is done by iterating through all the columns that the client has subscribed for and do updateEvent.isFieldChanged(<<field>>) check.
I also have a separate ArrayCollection to hold on to each of the nonVisualTables created.
Originally Posted by
Mone
Did you see that -on the same PC- using a VisualTable with the same number of item/fields/updates is much better?
I have not checked this. I ll check it and I ll let you know today.
-
October 4th, 2007, 10:00 AM
#6
Hi,
how do you update your data provider?
Our VisualTable class extends the core ArrayCollection class.
Apart from the logic, to update the view we use something similar to this code:
Hope that helps.
-
October 12th, 2007, 07:31 AM
#7
That with a couple of other changes helped in bringing down the cpu usage from 90% to 40%. Even a page that works with VisualTable takes same amount of cpu. But the memory usage was about 20% better than the NonVisualTable approach.
But I still feel 40% cpu usage on the client side is bad in either approaches. What could be wrong?
-
October 12th, 2007, 01:14 PM
#8
Hello,
Most of the CPU is used to show data on video. You could remove visual effects (if any), reduce the number of updates per second and so on to try to get better performance.
Please try to subscribe your NonVisualTables but remove every visual "notification" (i.e. just subscribe and use an empty NonVisualItemUpdateEvent listener). How much CPU is used?
With the NonVisualTable approach more memory is used because each item must be handled by 2 objects (the ArrayCollection and the NonVisualTable) and so some data is kept by both. The VisualTable extends the ArrayCollection and is written so there is no redundancy on data.
Moreover the Flash player uses a "step" approach to allocate memory from the system. See http://blogs.adobe.com/aharui/2007/0...nd_memory.html
Similar Threads
-
By Hammer7 in forum Client SDKs
Replies: 1
Last Post: August 16th, 2010, 09:31 AM
-
By giangum in forum Client SDKs
Replies: 1
Last Post: September 1st, 2009, 09:20 AM
-
By riwang in forum Client SDKs
Replies: 3
Last Post: May 21st, 2009, 09:37 AM
-
By rsouissi in forum Adapter SDKs
Replies: 7
Last Post: December 11th, 2006, 09:26 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
All times are GMT +1. The time now is 04:28 PM.
Bookmarks