Does comment out container eats up execution time?

I appreciate the forum here and the uipath community, saved me from a lot of troubles just by looking up for information on here…always found something useful. But with this one, my quest for answers hasn’t been fruitful so far, so I thought ill create this topic myself.
The current task im focusing on is to optimize this project where I added some enhancements. The workflow analyzer helped a lot, it helped me reduce the overall execution time and I was able to make sure the coding norms are followed. I was trying to make the code more presentable and readable, thats when I came across at lot of sequence of activities that are in the Comment Out container. Ive removed some of the comment out containers but the entirety of the project contains roughly around 150-200 of such comment out containers. I dont want to do the labrous task of deleting them one by one, please help me figure out the following things here,
1.) Is there a wizard or tool that can help me with this and remove all the comment out containers in a project.
2.) Should I even bother to do this? I want to know that does the comment out container eats up the execution time?
Now im aware that the activities that are within the container will be ignored during the run time as the bot will obviously recongnize that its within comment out and move ahead, but I wanna know that, for the bot, will the act of identifying that the next activity in line is enclosed within a container, eat up the execution time or not?
Now im gravitated towards thinking like this is cause when we debug the code and see the execution trail, I can see that the comment out container is highlighted when the bot reaches it and then ignores it, will it eat up execution time? during run time.
Really looking forward to hear back from the community, thanks.

Still looking for an update on this. I’ve found that the comment out container does get uploaded to the Orchestrator with the package, please refer the below screenshot, this is from the packages tab in the Orchestrator and inside the explore packages window,

image

I strongly believe that the bot will make a decision to skip the comment out block of code, and that decision making will most likely eat up some execution time. Just looking for someone to confirm the same, before I proceed with the manual work.

@Prashant_Semwal
Welcome to the forum

Unfortunately not a removal and only for the detection:
Rule: ST-MRD-REPLY001 - CommentOutUsageRule

If tunings would come to a so strict point, then you could run stopwatch tests and check the consumption samples when running (do not check measures on debugs).

Depending on your project / teams / implementation standards the unneeded comment-outs will more influence the readability / getting understanding when new developers will take over the code and maybe less on some little time consumption.

Coming back to the point of mass removal. With some little practice, a direct work on the xaml file can be set up to do the mass removal. But whenever working at this level, take always care of taking backup of the xamls before doing it.

1 Like

Yes, but the difference is tiny in Run mode (executing comment out in a For Each 1M times is about 1s on my machine while without it it’s 750 ms). Generally speaking, if this is the level of optimization that matters to you, you probably want to write code in C, Rust or some other high-performance language, not UiPath.

Code quality is a better reason to remove them as they clutter up the workflow and anyone new looking at the code base would have to decide to read or ignore them.

1 Like

Hello @Prashant_Semwal

As per my understanding, it will take only to seconds to check whether an activity is commented. It will not take the execution time of the activity.

Also currently there is no functionality to remove the commented activities.

Thanks

1 Like

Thanks for your inputs. I’ve removed all the comment out containers from the project, it helped me narrow down the end to end execution time. I’ll post about my observation as a different comment. Really appreciate you reaching out.

Thanks for your inputs. I’ve removed all the comment out containers from the project, it helped me narrow down the end to end execution time. I’ll post about my observation as a different comment. Really appreciate you reaching out.

All our business’s needs that we have automated are not solely built only with RPA. We strongly believe that to make a project more scalable, reliable and consistent, we’ve to expand our domain and make use of anything and everything that help us reduce execution time and make the project more consistent.
The project regarding which I’ve raised this concern makes use of uipath and python.

Thanks for your inputs. I’ve removed all the comment out containers from the project, it helped me narrow down the end to end execution time. I’ll post about my observation as a different comment. Really appreciate you reaching out.

with an unhealthy amount of caffeine and some motivation, I have removed all the commented out containers from the project. There were a total of 550-560(code review was not fun at all) of these containers. Please find my observations below,

1.) since the project was built upon transactional approach, processing 30 transaction in a single run, which makes it to 560*30= 16800 instances of bot making a decision to skip the commented out container, I had no choice but to remove it.

2.) the execution time for a single transaction was narrowed down by 130 seconds. The entire process execution time 30*130 = 65 minutes, more than enough for me to boast about my added enhancements xD.

**the reduction in the execution time I’m calculating here is not just the time wasted to skip the commented out container, but I made use of the workflow analyzer to make other decision too such as removing all the unconditional delay activities that were left in the code and have them within the condition check to remove unnecessary delay.

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