Optimization of the code

Currently I am using so many for loops in my workflow.Because of that,the code is taking almost 2 min to complete the execution for minimum set of inputs.
So I am looking for a way to minimize the run time.
Any suggestions would be helpful

Thanks in advance

if you are using a loop to populate a datatable, or to filter one, its better to use Linq instead, otimizing a good amount of time.

1 Like

I don’t have much knowledge in LINQ.Can you share some resources to learn about LINQ?

@ppr have a good sample example of using Linq with Uipath here. see below

[HowTo] - First Start with LINQ (VB.Net) - News / Tutorials - UiPath Community Forum

And if you want to learn more. They are good place to get started.

Language-Integrated Query (LINQ) (C#) | Microsoft Learn

LINQ Tutorial (tutorialspoint.com)

Happy learning

2 Likes

Hi @agathiyanv ,

If you could maybe provide us with a Sample of what needs to be done, then we could maybe provide a appropriate solution.

Providing Inputs and Expected Outputs for the Problem at hand and a Brief Description of the Problem (Clear) would help us understand and suggest a better approach.

Currently I am extracting table data from the XML via xpath using nested loop.
The xpath and field names are stored in the excel.
Outer loop is for each row ; It will read the xpath from excel file data table
Inner Loop:for each loop I am using XpathSelect Element function inside the loop.
Each iteration I am getting all tag values for that particular xpath (i.e column values in every iteration) and storing the values in the excel.
Now the issue it is so much time to complete the process.
So how can reduce the time?