Quantcast
Channel: Project Customization and Programming forum
Viewing all articles
Browse latest Browse all 5347

How to improve the performance of task dependency creation in a VSTO add-in when processing more than 2000 tasks

$
0
0

Hi,

We are trying to create 2000 tasks from a XML input and setting around 20 attributes for each task.

This process is taking around 4-5 minutes.

Then, we are trying to create the dependencies between tasks in the same process.

We are using the below code to create dependency.

     succTask=Application.ActiveProject.Tasks.get_UniqueID(succId);

     predTask=Application.ActiveProject.Tasks.get_UniqueID(predId);

      succTask.TaskDependencies.Add(predTask, linkType);

If the dependencies is volume is more, ex:- 1000), it is taking 10 more minutes.

We tried to optimize the code using the below settings.

                        Application.ScreenUpdating = false;
                        Application.DisplayStatusBar = false;
                        Application.DisplayAlerts = false;
                        Application.Calculation = MSProject.PjCalculation.pjManual;

                        processTasks()

                        Application.Calculation = MSProject.PjCalculation.pjAutomatic;
                        Application.DisplayAlerts = true;
                        Application.DisplayStatusBar = true;
                        Application.ScreenUpdating = true;

This actually reduced the dependency creation from 10 minutes to 6 minutes. But still it is not acceptable to the customer.

Are we following right approach to create dependencies?

Are they any other settings that we can disable/enable to improve the performance?

Thanks,

Murali


Viewing all articles
Browse latest Browse all 5347

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>