Nested Loop is taking too much time

Hello Folks,

I am using Fuzzy logic to match certain value from a text. For that, I am using nested For each Loop. But it is taking too much time.
ArrOfStr count is 30 and ArrOfOCR count is 2080.

Total No. of iterations = 30*2080 = 62400
Per iteration, it is taking 4 milliseconds. That amounts to 249 sec = 4 mins (which is huge time)

How can i reduce it to 1 min. Please suggest

So ur getting a text, and u want to know if that text is present in a collection?
Sounds like u want to use a dictionary for constant O(1) lookup, it will be a lot faster than iterating a collection. Keep in mind ur dictionary has overhead when creating it so perhaps create the dictionary in init so u don’t recreate it for every transaction.

Hello @kali

My arrOfStr and ArrOfOCR is dynamic based on scenarios. So, can’t implement it as per your suggestion.

Hi,

How about using InvokeCode activity or Coded Automation (and write your logic as code). It will reduce overhead of processing activities.
And if you run as debug mode, can you try just run?

Regards,

@Asfaque

Try checking if you can use linq

Cheers

I have tried the same using Invoke Code. It has helped me somehow.

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