This is a migrated thread and some comments may be shown as answers.

Book Control & Memory

25 Answers 174 Views
Book
This is a migrated thread and some comments may be shown as answers.
Helen
Top achievements
Rank 2
Helen asked on 12 Feb 2010, 05:28 PM
I have been experimenting with the Book Control and I find that it consumes a lot of memory. In my case I have 3 different page templates: one for the first page (a Table of Contents), one for displaying master data from master-detail data, and a second for display a page with the detail.

I have tried various configurations. First, I used frame caching for each book -- caching both the data (obtained using WCF Services) and the actual book. The books I am building have something like 30 odd pages. If I have two separate pages, each with its own book, I find that the memory use is something like 900,000 KB. So I tried a scheme of caching only the data, and rebuilding the book control each time (i.e. I set NavigationCacheMode="Disabled") for the frame. Now I find that switching pages takes too long to go to the new page (I presume as resources are being freed). That is, once the user has navigated to both pages (so that the Books have been fully populated), when they move to the previous page, there is a noticable wait while the current page stays displayed, before the new page is displayed. I would much prefer that the user see the new page right away, while Silverlight cleans up things in the old page, but I can't seem to get that to work. I repopulate the Book from the cached data in the Loaded event handler. I tried using the OnNavigatedTo method, but it errored out because the controls were not properly initialized when the method gets called.

Does anyone have any suggestions as to how I can get this to work better?

I am coming to the conclusion that the Book Control is only suitable for small books -- maybe 10 pages max. Can anyone suggest how I can conserve memory? Would using only one page template save memory?

Thanks for any guidance you can give me.

Cheers,

Helen

25 Answers, 1 is accepted

Sort by
0
Ben Hayat
Top achievements
Rank 2
answered on 12 Feb 2010, 11:16 PM
One of the points that I had strongly suggested to the team, even before the book was created, that it needs a virtual engine to be considered in real situations, rather relying on ItemsControl of SL. Would that be possible for you to provide the team a copy of your project for them to see where the problem is manifesting internally and secondly [and hopefully] if they are working on a an engine, your project might be a good test.
I wish I had a solution to give you, but I had run into similar problem with another product which was also relying on ItemsControl and I see the same here as well. Maybe the team can shed some light where this project is going!

..Ben
0
Helen
Top achievements
Rank 2
answered on 12 Feb 2010, 11:29 PM
I would be more than happy to provide the team with my test project. It uses a SQL Server database and WCF to communicate with the server. I could give them a copy of the database as well, although as it is about 23 MB I would need a way to upload it.

At the present time I am looking at switching from using the Book Control to perhaps the CoverFlow, as in the CoverFlow I can design things so that the controls are reused by the data, whereas with the Book Control, each page contains a new set of SL Controls, which is where I suspect the memory is being gobbled up. But that's just a guess.

Does this need to be elevated to a support ticket?

Thanks Ben!
0
Helen
Top achievements
Rank 2
answered on 14 Feb 2010, 01:59 AM
Ben, I have been thinking of converting to using the CoverFlow control instead of the Book. But I wonder whether it will save any memory? It too derives from the ItemsControl, doesn't it?

Thanks for any insights you can pass along.

Cheers,

Helen
0
Ben Hayat
Top achievements
Rank 2
answered on 14 Feb 2010, 04:18 PM
Hi Helen;

After I read your previous post, I was going to respond, but I thought I give you some time to think about what you were going to do, and I was right, you did. :-)

Both controls (Book and CF) uses TemsControl which isn't suited for what we are trying to throw at it. Imagine you buy a Mini car, even though it looks like a fast and cute car and trying to race a Porsche 997 Twin Turbo. So, what we need from  the good folks at Telerik to build us a nice data engine that we can put it in the Mini and beat the crap out of the Porsche :-) [I know the product manager likes Audi, so let's what happens].
0
Helen
Top achievements
Rank 2
answered on 14 Feb 2010, 04:31 PM
Thank you Ben -- you have saved me a spot of work that in the end was not going to solve my problem. I'm going to have to rethink my UI for this app.

Should we add this as a suggested feature to PITS?

I also would like to see control suite providers such as Telerik provide data access components that run on a background thread, so that while the user is browsing the site, the app can be loading data in the background. My idea is that the Silverlight app could have a manifest that the background processor uses to get data for each item on the manifest. It would raise an event when the data for each item on the manifest has been returned. There would be a need to synch with the UI thread so that if the UI thread needs data that is currently being fetched in the background, it could raise the priority of the background thread or something; if it needed data that is onn the manifest but the fetch has not yet started, it could remove the item from the manifest and do the fetch.

Does that make sense to you?

I am not using Ria Services yet because I need to get something out the door now and Ria Services does not work in a partial trust environment on the server (until SL4). Even then, I don't know whether SL4 is envisaging providing this kind of plumbing.

What do you think?

Regards

Helen
0
Ben Hayat
Top achievements
Rank 2
answered on 14 Feb 2010, 06:22 PM
Helen I have told them about the engine and they know it, but putting in in PITS, it basically confirms that more people need it and that what the team goes by. So, go ahead and put in PITS, and I secretly go and make 100 votes :-)

Digging deeper into the engine, you're right on spot as far as using background thread and I'm sure that's something the team would consider. I won't repeat all the details you provided, but I agree.

As far as RIA is concern... RIA's strength is creating a 3-tier data pluming that feels more like a 2-tier to developer to develop, but takes care of getting data to client. Now, here comes the tricky part about what we are asking Telerik to do:
a) Are we asking Telerik to basically reinvent the RIA wheel and go get the data from the server? [Which I think it's not fair to do that]
b) Or are we saying, hey let RIA brings us the data from the server and then let Telerik build a middle guy between RIA Client side and the Book? What I'm saying is that, the middle guy [virtual data engine] is the one who is asking RIA for data when he needs it, via PagedCollectionView and then feeds it to the book. So, from the book points of view, we ask virtual engine, to give us 200 items, it becomes his responsibility how often he talks to RIA to get those in different batches to make the UI thread snappy.
This is how I picture Telerik team use RIA to their advantage and just write the client engine.

TEAM: What do you guys think about these ideas. I'd like to see those smart guys at Telerik make some comment here.
Thanks Helen for fueling the fire! :-)
0
Kiril Stanoev
Telerik team
answered on 15 Feb 2010, 12:12 PM
Hello guys,

I've talked to the team and we are planning to work on RadBook's UI virtualization next week. However, I cannot bind to this 100%. I'll give you an update on the topic in the beginning of next week.

Sincerely yours,
Kiril Stanoev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Ben Hayat
Top achievements
Rank 2
answered on 15 Feb 2010, 01:12 PM
Hi Kiril;

I cannot bind to this 100%.
Do you mean until next week or in general speaking?
0
Kiril Stanoev
Telerik team
answered on 15 Feb 2010, 01:23 PM
Hello Ben,

What I mean is that if something urgent doesn't come up, we will start working on the virtualization in the beginning of next week. I have also logged the item in the PITS so you will be able to track its progress.

Sincerely yours,
Kiril Stanoev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Ben Hayat
Top achievements
Rank 2
answered on 15 Feb 2010, 02:14 PM
I have also logged the item in the PITS so you will be able to track its progress.

Kiro, is it still that 24 hours delay on the PITS before your post would show up? I wanted to put my vote on it, but I don't see it. It would be great to add Issue ID to the grid, so we can go to an issue directly (just made a suggestion to add to PITS).

Thanks for the clarification of Binding.
0
Kiril Stanoev
Telerik team
answered on 15 Feb 2010, 02:31 PM
Hi Ben,

Usually it takes a day before the item is visible in the PITS. The title of the item is "Book: Virtualization". I'll make sure to post a link in this thread once the PITS item is available.

Regards,
Kiril Stanoev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Ben Hayat
Top achievements
Rank 2
answered on 15 Feb 2010, 02:33 PM
Thank you Sir;
0
Helen
Top achievements
Rank 2
answered on 15 Feb 2010, 02:40 PM
Thanks very much Kiril.

Is it too much to ask for an ETA of when this feature might be available? I'm kind of behind a rock and a hard place with the project I am developing. I would had to have to remove the book control and redo the UI.

Also, Ben & Kiril, could you explain to me how "virtual engine" would work?

Thanks

Helen
0
Ben Hayat
Top achievements
Rank 2
answered on 15 Feb 2010, 02:53 PM
Also, Ben & Kiril, could you explain to me how "virtual engine" would work?
Well, I'm really nobody here to talk about their direction, but Kiril is 'D' Man! :-)
0
Accepted
Kiril Stanoev
Telerik team
answered on 15 Feb 2010, 03:12 PM
Hello Helen,

If everything goes according to plan and we start working on the virtualization next week, it should take approximately a week, at most a week and a half to finish it off. The easiest way to explain UI virtualization is to quote Bea Stollnitz:

A control that supports UI virtualization is smart enough to create only the UI elements needed to display the data items that are actually visible on screen. For example, suppose we have a scrolling ListBox that is data bound to 1,000,000 items but only 100 are visible at any time. Without UI virtualization, the ListBox would create a million ListBoxItems – a slow process – and include them in the UI, even though only a hundred of them are visible. With UI virtualization, on the other hand, the ListBox would only create 100 ListBoxItems (or a few more, to improve scrolling performance).

Therefore, once we implement virtualization in the book, the control will display 4 pages at most which is necessary for a successful page flip.

Let me know if you guys have additional questions or comments on the topic.

Kind regards,
Kiril Stanoev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Helen
Top achievements
Rank 2
answered on 15 Feb 2010, 03:20 PM
Kiril, that makes perfect sense and will indeed solve the problem.

Will you be using the same technology with the CoverFlow?

Thank you, thank you, thank you! My client is very happy with the Book Control for our project, and I would hate to have to abandon it. Now I can change my code to cache the data, not the controls, and know that it will work when the virtualized verison is released (hopefully soon :)).

And a special "thank you" to Ben, for your interest and support.

Cheers,

Helen
0
Helen
Top achievements
Rank 2
answered on 15 Feb 2010, 03:24 PM
One question:

The way I have designed my Book Control page templates, there is one for the first page which contains a table of contents, then two others depending on the content.

Will having this first page work with the virtualized control? I also have a combo box that allows users to jump to certain pages (i.e. the first page of a chapter).

Should I rethink this design?

Cheers,

Helen
0
Ben Hayat
Top achievements
Rank 2
answered on 15 Feb 2010, 04:08 PM
Let me know if you guys have additional questions or comments on the topic.
Kiril, a few posts back I made a comment about getting data [in particular data from database in my case], and how I sort of picture it in my head to get the data.

Now, you have given us a more detailed info about having a UI virtualization engine that will solve the problem of showing lots of data. However, I was wondering if you can elaborate "How" you plan to go to database and get the data? Will you be using the RIA platform to get to database and use that plumbing system? Or will you be building a custom WCF service similar to what the SL Print client uses to get data from database? Or What?

This is essential to know, how we can mix it and coordinate it within an application that is working with RIA Services, particularly if RIA is maintaining the "States" of data between client and server.
Is this the same engine that the RADGridView is using that actually work with underlying plumbing platform?

@Helen: And you're welcome! :-) Actually I have a great relationship with the team. This is one company that the team(s) are very open minded to discuss and get feedback from the customers like us. And since your posts are all great and in the right direction, I also bring different points to give the team the feedback they can use. It's a win, win situation for all of us... (except Kiro, more work for him :-)
..Ben
0
Helen
Top achievements
Rank 2
answered on 15 Feb 2010, 04:31 PM
Hi again folks,

First, I have to agree with Ben that Telerik is great to work with because they actively work with their developer users.

For me, the very highest priority is to implement the UI Virtualization engine for controls such as Book & CoverFlow, because without it your most impressive controls really can't be used in production sites that have more than a few content items. I didn't purchase your Silverlight Control Suite to get things like combo boxes -- it was the more powerful controls that I need. So this is really important to me.

The whole data thing is complicated because we don't know for sure what Microsoft has coming down the pipe with Ria Services. I initially used Ria Services in my current project (be the first one on your block to use the latest "x" technology) and then had to yank it all out and revert to WCF because my site is hosted in a partial-trust environment, and I can't wait for a few months for SL4 (i.e. .Net 4) to be released.

That being said, I still would like to see configurable background processing to get data, whether it uses WCF, Ria Services, or whatever. Like I said elsewhere, I would like to pass a manifest of the data I want to get (in the order that it appears in the manifest) and have a background worker thread go about getting the data while the app is being used. Of course it would have to handle the following situations gracefully:
 - the UI thread needs data that is on the manifest but the background thread has not started to fetch it yet. So the data item would need to be removed from the manifest and the UI thread be able to retrieve the data it needed, regardless of what the background thread was doing, and not having to wait on the background thread.
 - the UI thread needs data that the background thread is in the process of retrieving -- don't know if this means that the priority of the background thread would need to be raised or what.

This would allow the developer to design their app to retrieve and cache data before the app needs it, so that it could respond more quickly when the user navigates to a page that requires data -- if the background thread has already retrieved it, the page would simply bind to the data; otherwise, it would retrieve the data, cache it, then bind.

I think this would be very nice functionality to add to your product line

Cheers,

Helen
0
Kiril Stanoev
Telerik team
answered on 16 Feb 2010, 11:26 AM
Hello guys,

First, let me just give you the link to the PITS item associated with the book's virtualization:
http://www.telerik.com/support/pits.aspx#/public/silverlight/1031

Second, I'd like to thank both of you for the great feedback and suggestions. Currently we will focus on virtualizing the book, along with other necessary features.

We do not plan to provide any WCF or RIA functionality out of the box. For the moment, this will be left to the user to pick his/her approach. We will create examples for using the book with RIA and WCF after Q1.

Best wishes,
Kiril Stanoev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Ben Hayat
Top achievements
Rank 2
answered on 16 Feb 2010, 01:40 PM
Thanks!
0
Helen
Top achievements
Rank 2
answered on 16 Feb 2010, 05:16 PM
Hi Kiril,

I have to say that I think you are making a very good decision on concentrating on the Book, and in particular the virulization of same. The other features are not show-stoppers, but the memory issue is (at least for me).

I also think you have a competitive advantage with your Book Control, as so far the competition has nothing that matches it. I started using the free Mitsu Book Control (and for something freely available it is really good, so I don't mean to diss it). But I started to find quirks that I was not willing to try and fix with resizing, and also it too takes too much memory.

My client, however, really likes the concept. The fact that there are a ton of Flash book controls also suggests that it is very marketable.

Thanks again for making it a priority.

Helen
0
Ben Hayat
Top achievements
Rank 2
answered on 16 Feb 2010, 05:32 PM
Helen, I've been singing that song for almost two years to these boys and they finally got tiered of me and said "Ok, we'll do it, if you stop singing...:-)
0
Helen
Top achievements
Rank 2
answered on 16 Feb 2010, 05:36 PM
Voice training perhaps, Ben? (Just kidding)

I have to think that you have a twin brother with the same name over at Dev Express .... They didn't listen either, did they?

Anyway, glad we got it headed in the right direction.

laters

Helen
0
Ben Hayat
Top achievements
Rank 2
answered on 16 Feb 2010, 05:59 PM
Yes, my "twin" brother (with the same name of course) was an old customer of DevEx for many years. But in life you have to go for better and better, even if that requires changes!

When Telerik decided to work on the book (after nagging at them for a long time), the product manager (Valentin) told me one day, that they're starting to work on the book and asked me what I like to see. Wow, I said. I then started putting together a long list of features with samples so they can get a good picture of what the market expects.
Although, currently this is version 1, but Kiril (the lead developer) had done a VERY good job building the foundation. And based on this, I have a strong faith it will get to great places [in the next decade :-) :-) ]!
Tags
Book
Asked by
Helen
Top achievements
Rank 2
Answers by
Ben Hayat
Top achievements
Rank 2
Helen
Top achievements
Rank 2
Kiril Stanoev
Telerik team
Share this question
or