Why invoke code activity use for a long time to proccess on the easy code?

Hi all, I’ve use invoke code activity it’s just code about calculate string number but why it’s use time to proccess too long(1s-5s)?


@jnfantasy4,

When using the Invoke Code activity in UiPath Studio, the processing time can sometimes be longer than expected due to various factors. Here are some common reasons and potential solutions:

  1. Initialization Overhead: Each time the Invoke Code activity is executed, there is a small overhead associated with setting up the execution environment. This can contribute to the overall time taken, especially if the activity is used repeatedly in a loop.
  2. Code Efficiency: The efficiency of the code inside the Invoke Code activity itself can significantly impact the processing time. Inefficient algorithms, unnecessary computations, or excessive use of resources can lead to longer execution times.
  3. Complexity of String Operations: If the string operations being performed are complex, such as handling very large strings or performing multiple concatenations and splits, this can add to the processing time.
  4. System Resources: The available system resources (CPU, memory, etc.) can also affect the processing time. If the system is under heavy load or has limited resources, the execution time can increase.
  5. Garbage Collection: The .NET runtime may trigger garbage collection during the execution of the Invoke Code activity, which can temporarily pause the execution and add to the processing time.

LLM helped me to write this.

Thanks,
Ashok :slight_smile:

1 Like

I just try to “hello world” but still use time too long.

1 Like

@jnfantasy4,

Try to check in Run mode as well. Debug could be slower than run.

Thanks,
Ashok :slight_smile:

same result 5s :smiling_face_with_tear:.

@jnfantasy4,

Ohh ok. That’s significant! Lets see what others thought on this.

Thanks,
Ashok :slight_smile: