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

SpecialSlotStyleSelector performance

20 Answers 221 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Ken
Top achievements
Rank 1
Ken asked on 03 Oct 2011, 10:38 AM
Hi,

I'm need to highlight non-working days and hours in the schedule view, like this:
1. Highlight weekends
2. Highlight week days outside 8-17 hours

For this I followed the example in the demo, by creating a NonWorkingSlot, a collection of them, binding it to the SpecialSlotsSource of the ScheduleView and a SpecialSlotStyleSelector. 

It works, but performance is really really bad. Even mousing over the slots is slow and scrolling as well. Probably I don't create the NonWorkingSlots correctly. I would ideally like them to span "forever", but as this yielded horrible performance, I tried starting them "5 years ago". This is still very slow. Here's the code:

       
private IEnumerable<Slot> CreateNonWorkingSlot(ResourceCollection resources)
        {
            var recurrenceStartDate = DateTime.Today.AddYears(-1);
 
            // Weekends
            yield return new NonWorkingSlot(recurrenceStartDate, recurrenceStartDate.AddDays(1), resources.Cast<object>())
            {
                RecurrencePattern = new RecurrencePattern(null, RecurrenceDays.WeekendDays, RecurrenceFrequency.Weekly, 1, null, null)
            };
 
            // Week days 00:00 -> 08:00
            yield return new NonWorkingSlot(recurrenceStartDate, recurrenceStartDate.AddHours(8), resources.Cast<object>())
            {
                RecurrencePattern = new RecurrencePattern(null, RecurrenceDays.WeekDays, RecurrenceFrequency.Daily, 1, null, null)
            };
 
            // Week days 08:00 -> 17:00
            yield return new NonWorkingSlot(recurrenceStartDate.AddHours(17), recurrenceStartDate.AddHours(24), resources.Cast<object>())
            {
                RecurrencePattern = new RecurrencePattern(null, RecurrenceDays.WeekDays, RecurrenceFrequency.Daily, 1, null, null)
            };
        }


What am I doing wrong?

Thanks!

20 Answers, 1 is accepted

Sort by
0
Christian Burkhardt
Top achievements
Rank 1
answered on 05 Oct 2011, 12:20 PM
Anyone there? Any news on this problem?
0
Konstantina
Telerik team
answered on 06 Oct 2011, 03:18 PM
Hi Christian,

I tried to reproduce the issue, but to no avail. The slots are recycled every time the view or dates are changed, so the performance depends on the style you are loading. If it is too heavy and complicated, probably this is causing the issue.
Attached I am sending you a short video with my attempt.
Could you please send us your styles and your project, so that we can review it and track down the source of the problem.

All the best,
Konstantina
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Christian Burkhardt
Top achievements
Rank 1
answered on 16 Nov 2011, 03:07 PM
Hi Konstantina,

In the code I posted, replace the first line with this:

var recurrenceStartDate = DateTime.Today.AddYears(-50);

Then try with your template from the movie (i.e. a Border with some background), having the ScheduleView as timeline. Do you still get good performance? If yes, maybe you can attach your sample project?

Thanks!
0
Konstantina
Telerik team
answered on 18 Nov 2011, 03:23 PM
Hello Christian,

Attached I am sending you my test project. Could you please modify it so that we can observe the issue you are experiencing. In that way we will be able to track down the source of the problem and provide you with solution.

Looking forward to your reply.

Greetings,
Konstantina
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Christian Burkhardt
Top achievements
Rank 1
answered on 18 Nov 2011, 04:16 PM
Hi Konstantina,

Please see the linked file. I added some resources to the scheduleview and also some appointments for them.

http://www.sendspace.com/file/xosxut


To repro:
1. Start the app
2. Scroll horizontally

Expected: scrolls smoothly
Actual: scroll is very choppy and slow.

Now, if you remove the line in the code where the nonworkingslots are added, try again and you will see that it works perfectly without them.

So, I guess there is a performance problem with these special slots.
0
Konstantina
Telerik team
answered on 23 Nov 2011, 03:59 PM
Hi Christian,

Thank you for the sample project.

Seems that there is a performance issue, indeed. To optimize it I can suggest you to remove one of the repeating special slots:

this.workingHours.Add(
             new NonWorkingSlot(recurrenceStartDate, recurrenceStartDate.AddDays(1), resources)
            {
              RecurrencePattern = new RecurrencePattern(null, RecurrenceDays.WeekendDays, RecurrenceFrequency.Weekly, 1, null, null)
            });
 Because that creates two equal slots on top of each other.
Also, you might consider reducing the number of the resources and implementing paging.

Hope this info helps.

Greetings,
Konstantina
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Christian Burkhardt
Top achievements
Rank 1
answered on 23 Nov 2011, 04:04 PM
Hello Konstantina,

Thanks for the suggestion. However, can you provide some info on what is the underlying performance issue in the ScheduleView control? And if/when it's going to be fixed?

To be honest "reducing the number of resources" is not a good answer, since the control docs state it supports lots of data and virtualization. Also, in the given example there are just a dozen resources, imagine using the control for planning hundreds...

I'm not sure what you mean exactly by paging. My current implementation actually creates special slots only for the visible range. This helps a lot with performance, but there is still a noticeable hit, especially when there are lots of appointments.

So, it would be very helpful to have some idea if you guys are looking into fixing the underlying issue.

Thanks!
0
Konstantina
Telerik team
answered on 25 Nov 2011, 01:03 PM
Hello Christian,

Sorry, in this forum post you can find an example how to implement resource paging. We will definitely look into the performance issue, but for now I cannot give you a certain time frame since we already have planned our tasks for Q1 2012.

All the best,
Konstantina
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Tim
Top achievements
Rank 1
answered on 13 Dec 2011, 06:07 PM
Hi Konstantina,

We need this fix,too. Having 45 Resources in our ScheduleView it takes approx. 5 seconds to open a RadExpander which forces the ScheduleView to resize. If I remove all SpecialSlots the expander opens immediatelly.
0
Konstantina
Telerik team
answered on 19 Dec 2011, 05:52 PM
Hi Stefan,

We have researched the issue. Unfortunately, this slowness is caused by the RecurrenceRule and for now it cannot be much optimized. However, I can suggest you to try to create the slots on demand in VisibleRangeChanged event of the ScheduleView. You can use as an example this online demo. It demonstrates the same thing, but for appointments.

Hope this will help.

Kind regards,
Konstantina
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Tim
Top achievements
Rank 1
answered on 27 Jan 2012, 11:54 AM
Hi Konstantina,

thanks for your explanations. I replaced all recuring slots with several singe slots to avoid using the recurrance pattern property at all. However, performance is still bad (makes not much difference to using recurrance) when resizing or zooming ScheduleView.

I've always create my special slots only for the visble range thus there is no performance improvements possible it that point.

I assume that the number of special slots (approx. 200) is too high?

I need to use this feature to highlight weekends, public holidays and some events which are unique for single resurces...

The number of resources I use right now is 76. This should not be too much, but performance will be unacceptable on client machines as my developer machine (quad core i7) is not able to handle special slots. Please help!

Best regards,
Stefan




0
Konstantina
Telerik team
answered on 31 Jan 2012, 10:42 AM
Hi Stefan,

We are looking in the performance issue, but for now, so many resources are causing some problems. The work-around I can suggest you to decrease the load on the ScheduleView is to use resource paging and filtering of the appointments according to the visible range.

Sorry for the caused inconvenience.

Regards,
Konstantina
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Ken
Top achievements
Rank 1
answered on 16 Feb 2012, 04:06 PM
Any progress on this issue? It's really a shame that such a useful feature can't be used because it slows things down to a halt. I could imagine a performance improvement is possible when not using the recurrence rule and just creating the slots for the visible range (which I already do): I mean, without these special slots even with hundreds of resources and appointments the performance is good. Once I add in these slots, it all goes south.

Thanks!
0
Konstantina
Telerik team
answered on 22 Feb 2012, 05:13 PM
Hello Adrian,

As it turns out your scenario hits a corner case where our rendering logic faces some issues. We are making some research on possible ways how we can overcome them but we need more time for this. In the meanwhile I can suggest you not to create many special slots, but try to combine them in bigger ones. For example: if you need to mark the hours from 2pm to 5pm for all resources, create one special slot from 2 to 5, for all resources, instead of one for each time slot.

Hope this information helps.

All the best,
Konstantina
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Christian Burkhardt
Top achievements
Rank 1
answered on 22 Feb 2012, 06:00 PM
Hi Konstantina,

Thanks for the answer and suggestion: I am doing it already. It definitely helped, but unfortunately brought the state from completely unusable to mostly unusable :)

My particular use-case is that I have to create special slots to highlight non-working hours which are:
1. Normal non-working hours (e.g. 0am->8am + 17pm->0am)
2. Weekends
3. Holidays

Even for the case when I show just 7 days in the scheduleview timeline, these add up quickly.

Really looking forward to an improvement/fix from you.

Thanks,
Adrian
0
Shawn Shaddock
Top achievements
Rank 1
answered on 23 Mar 2012, 08:19 PM
I am also having this issue. I use special slots to mark at what interval each resource can book appointments, as well as store hours, and resource hours.
0
Ken
Top achievements
Rank 1
answered on 23 Oct 2012, 03:13 PM
Any news on this?
0
Konstantina
Telerik team
answered on 26 Oct 2012, 02:49 PM
Hello,

After some research, for now the special slots performance cannot be improved without a major refactoring of the code, which is not planned at the moment, because it will cause a lot of breaking changes which we avoid. For optimization I can suggest you to take the following measures:

- populate the slots only in the visible range at the moment;
- when there is the same slot for more resources, not create different slots for each resource, but assign the resources to the slot, for example:

var slot = new FancySlot { Start = DateTime.Today.AddHours(2), End = DateTime.Today.AddHours(2) }; 
slot.Resources.AddRange(resources); 
this.specialSlots.Add(slot);
- if the slot is recurring, again not to create many different slots, but create a recurring one.

Hope this will help and sorry for the caused inconvenience.

Greetings,
Konstantina
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Håkan
Top achievements
Rank 1
answered on 26 Aug 2014, 12:53 PM
Hi there!

Any update on this issue?

I have the same problem, but still running an old Silverlight 4 version.
I just want to know if there was any solution to this problem in a later (Silverlight 5) version of the ScheduleView?

Regards,
Håkan
0
Kalin
Telerik team
answered on 27 Aug 2014, 01:32 PM
Hi Håkan,

I'm afraid the special slots performance hasn't been improved yet. However we have that issue logged in our Feedback portal, so you can easily track it status on the following link:
http://feedback.telerik.com/Project/143/Feedback/Details/113662-improve-performance-when-using-special-slots

Just follow the item in order to get notified whenever its status is changed.

If you have any other question or concerns, please let us know.

Regards,
Kalin
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
ScheduleView
Asked by
Ken
Top achievements
Rank 1
Answers by
Christian Burkhardt
Top achievements
Rank 1
Konstantina
Telerik team
Tim
Top achievements
Rank 1
Ken
Top achievements
Rank 1
Shawn Shaddock
Top achievements
Rank 1
Håkan
Top achievements
Rank 1
Kalin
Telerik team
Share this question
or