Katalon TC Execution Speed very slow ... Armstrong number from zero to 154

Hi, I have created a simple function to to print Armstrong number from zero to 154.
The below code execution took around 8 min in Katalon, where as the same code hardly took less than a sec in Eclipse.

****** Please respond after executing the below code ******

Katalon Version : 6.2.1
My log level logging.level.testcase=INFO
Installed Memory : 16GB
SSD: 500 GB
-Xms2048m
-Xmx4096m

getArmStrong(153)

public static boolean isArmStrong(int num){

int cube =0;
int r; // reminder
int t; // temp variable

t = num;

while (num >0){

  r=num%10;  
  num=num/10;
  cube=cube+(r*r*r);

}

if(t==cube){

  //println ("*** Is a Armstrong No ***")
  
  return true;

}else{

//println (“Is NOT Armstrong No”)

}
return false;

}

public static void getArmStrong(int num){

  for (int i=0;i<=num;i++){

  	if(isArmStrong(i)){

  		System.out.print (i + ", ");
  	}

  }

  System.out.println (" ");

}

I run your code in about 0.035s. No problem on my side.

Strange … Did you execute in Katalon Studio? Should I make any Katalon setting changes?

Even after the execution is completed in Job Progress, the LogViewer tab keep executing something in the background. In the mean time, if you retry to re-execute the code again… Katalon freezes.

Kindly check the below screenshot for details.

@kazurayam @devalex88 … Can you please execute the code from your end.

The log viewer isn’t executing stuff anymore. The display output is just much slower than the execution.I wasn’t having the same problem because I put your code into a class and not directly in the test case. Try making Keyword and use the call to the function instead.

@Nilau … Thanks your reply.

My question is … why in test case, it is taking lot of time to execute?

The execution (the mathematics behind your function) is fast. What takes time is displaying action in the log. I don’t know why it takes more time but I have the same thing running tests, sometimes it goes so fast the log viewer can’t follow. Usually, the console display is fast.

When you’re outside of test case, it doesn’t use the log viewer as output so it’s way faster.

Appreciate your reply. @Nilau

1 Like