UiPath Datatable Loop Performance Issue

In relation to the thread above, I am prompted to ask

if there are other ways that UiPath performance could speed up during datatable looping.

For illustration purpose,

  1. I am attaching two projects that both generate numbers from 1 to 99999.
    LoopPerformanceIssue.zip (37.6 KB)
  • ByMacro → Executes a macro to generate the numbers.
  • ByUiPath → Simply performs Add DataRow to DT then saves to excel.

Execution Time

  • ByMacro → 1.19 min
  • ByUiPath → almost 1hr
  1. Tasks like renaming and moving files have the performance result.
    (no WF attached. :sweat_smile:)

No. of files to rename/move from one folder to another: 38000

  • In UiPath → 7.25hrs
  • In Macro → 35min

I know there is nothing wrong with using Macro,
but there are clients who want to purely use UiPath for implementation.
(especially for environments without Microsoft Office)

What approach do you suggest?
Thanks in advance!

Sorry for the long post. :bowing_woman:

2 Likes

I executed the same attached code, it took 35sec for macro and 5sec for UiPath

instead of excel scope you can use Read Range from Workbook, it doesn’t required MS Office

image

3 Likes

Other than what @indrajit.shah has already said, I finally used pure UIPath, with Invoke Code activities wherever the complexity was high (like adding columns or rows in a specific position, complex loops, building HTML messages and so on). Not so quick like VBA macros, but way faster than UIPath activities doing the same.

1 Like

Hi @indrajit.shah

Thank you so much for the suggestion.
I changed the activity to Write Range from Workbook,
but it did not have significant change in speed.

Is it possibly because of my PC specs?
I have 8G RAM and i3-7130U CPU @2.70 GHz (4CPUs), ~2.7GHz Processor.
May I know yours?

1 Like

image

1 Like

Did you try executing the code in both debug and run mode? In debug mode the compiler won’t optimize the code which will make it run alot slower.

4 Likes

Hi @aeklof

Though I could have sworn I ran them in run mode before (around last year).
But now when I ran them in run mode, it was indeed fast! :woozy_face: :woman_facepalming:

I will try to perform operations inside the loop, like moving files to see its performance.

P.S. You’re a great addition to the community! Welcome to the forum!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.