# While loop executing slowly

**URL:** <https://forum.uipath.com/t/while-loop-executing-slowly/445425>\
**Category:** Studio\
**Tags:** while-loop, regex-extractor, ismatch, execution, workflow-analyzer, pdf-extraction, question, studio, pdf, system, activities\
**Created:** [June 4, 2022, 11:24am UTC](https://forum.uipath.com/t/while-loop-executing-slowly/445425 "2022-06-04T11:24:52Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![check\_account](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/check_account/32/272284_2.png) [@check\_account](https://forum.uipath.com/u/check_account)\
**Post date:** [June 4, 2022, 11:24am UTC](https://forum.uipath.com/t/while-loop-executing-slowly/445425/1 "2022-06-04T11:24:52Z")

</div>

Hi guys,  
I am performing ismatch to check the specific word in pdf file(large file).but the while loop executing slowly. it takes time around 3 minutes to get page number of that specific word.  
is it because of while loop or anything else?

i attached screenshot of workflow.

 ![S1](https://global.discourse-cdn.com/uipath/original/4X/b/7/9/b7976baa1afe60a39f87554836fed264b4ab4480.png)  
 ![s2](https://global.discourse-cdn.com/uipath/original/4X/2/f/5/2f5d67730728345c8a6052bd59c97f7c56153ed3.png)  
 ![S3](https://global.discourse-cdn.com/uipath/original/4X/e/4/b/e4b72d30914297f91a8eb2b275b6277ef122261c.png)  
 ![S4](https://global.discourse-cdn.com/uipath/original/4X/b/3/b/b3b8f36a821627d8d9c3f8a4755ff4a06ec35000.png)  
 ![S5](https://global.discourse-cdn.com/uipath/original/4X/6/7/0/67093bcfa0392d7078d52815b217c303a18a7061.png)

---

<div class="post-metadata">

**Author:** ![Yoichi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/yoichi/32/523754_2.png) [@Yoichi](https://forum.uipath.com/u/Yoichi)\
**Post date:** [June 4, 2022, 11:43am UTC](https://forum.uipath.com/t/while-loop-executing-slowly/445425/2 "2022-06-04T11:43:26Z")

</div>

Hi,

I think it’s better to check whether there is especially slow activity in your workflow, first.  
So can you try to debug with turning on LogActivites in ribbon menu and ShowTimestamp in Output panel, as the following?

 ![image](https://global.discourse-cdn.com/uipath/original/4X/d/2/3/d230a9c926ea1173eedc2c75c26c12025b2d75b9.png)

Regards,

---

<div class="post-metadata">

**Author:** ![Veera\_Raj](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/veera_raj/32/523251_2.png) [@Veera\_Raj](https://forum.uipath.com/u/Veera_Raj)\
**Post date:** [June 4, 2022, 11:44am UTC](https://forum.uipath.com/t/while-loop-executing-slowly/445425/3 "2022-06-04T11:44:06Z")

</div>

may be you trying to read scanned pdf with read pdf text you may have to use read pdf with ocr

---

<div class="post-metadata">

**Author:** ![check\_account](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/check_account/32/272284_2.png) [@check\_account](https://forum.uipath.com/u/check_account)\
**Post date:** [June 4, 2022, 12:24pm UTC](https://forum.uipath.com/t/while-loop-executing-slowly/445425/4 "2022-06-04T12:24:53Z")

</div>

> [@Yoichi](#):
>
> re is especially slow activity in your workflow, first.

log activities is disabled when i debug my workflow!!

---

<div class="post-metadata">

**Author:** ![Yoichi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/yoichi/32/523754_2.png) [@Yoichi](https://forum.uipath.com/u/Yoichi)\
**Post date:** [June 4, 2022, 12:30pm UTC](https://forum.uipath.com/t/while-loop-executing-slowly/445425/5 "2022-06-04T12:30:08Z")

</div>

Hi,

I suggested to turn on LogActivities for measuring the processing time for each activity.  
Or do you mean your studio is restricted to use LogActivities by governance?

Regards,

---

<div class="post-metadata">

**Author:** ![check\_account](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/check_account/32/272284_2.png) [@check\_account](https://forum.uipath.com/u/check_account)\
**Post date:** [June 4, 2022, 12:32pm UTC](https://forum.uipath.com/t/while-loop-executing-slowly/445425/6 "2022-06-04T12:32:42Z")

</div>

no its not scanned pdf @Veera_Raj but i dont know why its executing slowly ☹

---

<div class="post-metadata">

**Author:** ![check\_account](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/check_account/32/272284_2.png) [@check\_account](https://forum.uipath.com/u/check_account)\
**Post date:** [June 4, 2022, 12:35pm UTC](https://forum.uipath.com/t/while-loop-executing-slowly/445425/7 "2022-06-04T12:35:12Z")

</div>

![S6](https://global.discourse-cdn.com/uipath/original/4X/7/f/8/7f89ba626b199fc3c3d00718fb7ec5a3223f17ef.png)  
when i debugged, log activities greyed out @Yoichi

---

<div class="post-metadata">

**Author:** ![Yoichi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/yoichi/32/523754_2.png) [@Yoichi](https://forum.uipath.com/u/Yoichi)\
**Post date:** [June 4, 2022, 12:36pm UTC](https://forum.uipath.com/t/while-loop-executing-slowly/445425/8 "2022-06-04T12:36:17Z")

</div>

Hi,

Please turn on LogActivities before click Debug.

Regards,

---

<div class="post-metadata">

**Author:** ![check\_account](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/check_account/32/272284_2.png) [@check\_account](https://forum.uipath.com/u/check_account)\
**Post date:** [June 4, 2022, 12:49pm UTC](https://forum.uipath.com/t/while-loop-executing-slowly/445425/9 "2022-06-04T12:49:46Z")

</div>

As per your instruction i turned on and here the screenshot.

 ![log](https://global.discourse-cdn.com/uipath/original/4X/a/b/9/ab99eb67190fb3848623e11c96dc8a13063798ec.png)

---

<div class="post-metadata">

**Author:** ![Yoichi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/yoichi/32/523754_2.png) [@Yoichi](https://forum.uipath.com/u/Yoichi)\
**Post date:** [June 4, 2022, 12:52pm UTC](https://forum.uipath.com/t/while-loop-executing-slowly/445425/10 "2022-06-04T12:52:33Z")

</div>

Hi,

Please also turn on ShowTimestamp in Output panel. Then you can know process time of each activity from it.

Regards,

---

<div class="post-metadata">

**Author:** ![Veera\_Raj](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/veera_raj/32/523251_2.png) [@Veera\_Raj](https://forum.uipath.com/u/Veera_Raj)\
**Post date:** [June 4, 2022, 3:08pm UTC](https://forum.uipath.com/t/while-loop-executing-slowly/445425/11 "2022-06-04T15:08:42Z")

</div>

can you please attach xaml?

---

<div class="post-metadata">

**Author:** ![Nithinkrishna](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/nithinkrishna/32/561519_2.png) [@Nithinkrishna](https://forum.uipath.com/u/Nithinkrishna)\
**Post date:** [June 4, 2022, 4:37pm UTC](https://forum.uipath.com/t/while-loop-executing-slowly/445425/12 "2022-06-04T16:37:45Z")

</div>

Hey @check_account

What do you mean by large PDF file ?

Thanks  
#nK

---

<div class="post-metadata">

**Author:** ![Rahul\_Unnikrishnan](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/rahul_unnikrishnan/32/464046_2.png) [@Rahul\_Unnikrishnan](https://forum.uipath.com/u/Rahul_Unnikrishnan)\
**Post date:** [June 4, 2022, 5:31pm UTC](https://forum.uipath.com/t/while-loop-executing-slowly/445425/13 "2022-06-04T17:31:14Z")

</div>

Hello @check_account

During execution in debug mode, which activity is taking more time to load? Can you please monitor that?

Also you can do the debugging with stepInto method to understand whether the flow is happening as designed. As you mentioned the pdf is a large file, it can also cause the slowness. But better to validate the flow using the stepinto.

---

<div class="post-metadata">

**Author:** ![check\_account](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/check_account/32/272284_2.png) [@check\_account](https://forum.uipath.com/u/check_account)\
**Post date:** [June 6, 2022, 4:19am UTC](https://forum.uipath.com/t/while-loop-executing-slowly/445425/14 "2022-06-06T04:19:23Z")

</div>

[get\_text.xaml](https://forum.uipath.com/uploads/short-url/pOn6SbCcKLMkyaND4zGwRAzDWad.xaml) (13.1 KB)  
Here i added the xaml and please let me know the solution to speed up the execution 🙂

---

<div class="post-metadata">

**Author:** ![check\_account](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/check_account/32/272284_2.png) [@check\_account](https://forum.uipath.com/u/check_account)\
**Post date:** [June 6, 2022, 4:22am UTC](https://forum.uipath.com/t/while-loop-executing-slowly/445425/15 "2022-06-06T04:22:18Z")

</div>

ok i will moniter it and here i am attaching my xaml for your reference…and please let me know any ideas to prevent slow execution.  
[get\_text.xaml](https://forum.uipath.com/uploads/short-url/pOn6SbCcKLMkyaND4zGwRAzDWad.xaml) (13.1 KB)

---

<div class="post-metadata">

**Author:** ![check\_account](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/check_account/32/272284_2.png) [@check\_account](https://forum.uipath.com/u/check_account)\
**Post date:** [June 6, 2022, 4:33am UTC](https://forum.uipath.com/t/while-loop-executing-slowly/445425/16 "2022-06-06T04:33:50Z")

</div>

i am executing pdf file which has 652 pages dude 🙂

---

<div class="post-metadata">

**Author:** ![Veera\_Raj](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/veera_raj/32/523251_2.png) [@Veera\_Raj](https://forum.uipath.com/u/Veera_Raj)\
**Post date:** [June 6, 2022, 5:38am UTC](https://forum.uipath.com/t/while-loop-executing-slowly/445425/17 "2022-06-06T05:38:51Z")

</div>

can you share overall project folder with sample inputs?

---

<div class="post-metadata">

**Author:** ![supermanPunch](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/supermanpunch/32/133652_2.png) [@supermanPunch](https://forum.uipath.com/u/supermanPunch)\
**Post date:** [June 6, 2022, 5:41am UTC](https://forum.uipath.com/t/while-loop-executing-slowly/445425/18 "2022-06-06T05:41:17Z")

</div>

Hi @check_account ,

Could you maybe try shifting to a `For Each` Loop and Check if it is the same with that Activity as well ?

Most probably, the PDF being Huge is taking time to read it.

Let us know what is the Outcome.

---

<div class="post-metadata">

**Author:** ![Nithinkrishna](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/nithinkrishna/32/561519_2.png) [@Nithinkrishna](https://forum.uipath.com/u/Nithinkrishna)\
**Post date:** [June 6, 2022, 5:49am UTC](https://forum.uipath.com/t/while-loop-executing-slowly/445425/19 "2022-06-06T05:49:53Z")

</div>

> [@check\_account](#):
>
> i am executing pdf file which has 652 pages dude 🙂

This shouldn’t be taking much time actually speaking.

Thanks  
#nK

---

<div class="post-metadata">

**Author:** ![check\_account](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/check_account/32/272284_2.png) [@check\_account](https://forum.uipath.com/u/check_account)\
**Post date:** [June 6, 2022, 6:08am UTC](https://forum.uipath.com/t/while-loop-executing-slowly/445425/20 "2022-06-06T06:08:15Z")

</div>

Its sensitive information.but I can share sample pdf where you can search these words:

FORTRAN  
ALGOL  
COBOL

Get Page Number as 3

[Computer Programming.pdf](https://forum.uipath.com/uploads/short-url/lMV7yY3eO8055yLt5HKizbyeSdC.pdf) (204.2 KB)

[Next page](https://forum.uipath.com/t/while-loop-executing-slowly/445425.md?page=2)
