Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Performance Problems (Read 3337 times)
slederer
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 4
Joined: Jul 16th, 2008
Performance Problems
Jul 17th, 2008 at 9:38am
Print Post  
Hello,

I've tested the resource view component in one of your test application. Therefore i added 100 resources to the component with 25 appointments. But this was not possible because my Visual Studio 2005 brought a deadlock exception or the application do not react anyway.

This is my code for adding the appointments:
Code
Select All
foreach (Resource r in calendar.Schedule.Resources){

                for (k = 0; k < 5; k++)
                {
                    for (i = 0; i < 5; i++)
                    {
                        task = new Appointment();
                        task.HeaderText = "Task";
                        task.DescriptionText = "This is a task.";
                        task.StartTime = (new DateTime(2007, 7, 17 + k, i, 0, 0, 0));
                        task.EndTime = (new DateTime(2007, 7, 17 + k, i, 30, 0, 0));

                        task.Resources.Add(r);
                        calendar.Schedule.Items.Add(task);
                        j++;
                    }
                }
            } 



Greetings
Stefan lederer
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Performance Problems
Reply #1 - Jul 17th, 2008 at 10:55am
Print Post  
If you have added 100 resources to the schedule, it looks to me that the code you posted will create 2500 appointments instead of only 25. I have tried it in a sample application and the appointments were created successfully in a matter of seconds. However, I was using a Timetable view where many of the appointments are invisible due to the lack of space to display them. If you are using another view, it might take longer to display all of the appointments.

Anyway, you can use the following technique to speed up the appointment creation. Just keep in mind that your code as it is, will create appointments whose count is 25 times the number of resources:

Code
Select All
calendar.BeginInit();

// Put all of the initialization code in here

calendar.EndInit(); 


Meppy
  
Back to top
 
IP Logged
 
slederer
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 4
Joined: Jul 16th, 2008
Re: Performance Problems
Reply #2 - Jul 18th, 2008 at 7:28am
Print Post  
Thank you for your reply! It works!
  
Back to top
 
IP Logged
 
slederer
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 4
Joined: Jul 16th, 2008
Re: Performance Problems
Reply #3 - Jul 28th, 2008 at 1:37pm
Print Post  
I've another problem with my test application: when i drag an appointment through the calendar (fullscreen, 100 resources with 25 appointments per ressource), my CPU load goes up to 50% (1,8 GHz Dual Core CPU). It's also very slow in this case. Is this normal is this case? Have i done something wrong in my implementation?
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Performance Problems
Reply #4 - Jul 28th, 2008 at 2:47pm
Print Post  
Moving an item across a view forces a layout pass every time the item position is changed. In view with that many resources and appointments it is normal to experience slow-downs. Here are some tips that can improve performance:

1. Turn item shadows off or at least make the shadows solid. Fading shadows render very slow.

2. Enable rendering optimization through the Calendar.EnableOptimization property.

3. Set the Calendar.ItemModificationStyle property to anything other than InPlace. This will prevent the view from laying out all items every time a dragged item is moved. The items will be laid out once the dragged item is dropped.

Meppy
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint