Why is Javascript ReadLine() performance 100000% slower than Jscript?
I am in the process of converting our SmokeTest to javascript and we have a db error log we parse for Ora-errors. Before the conversion to javascript - this process took 12 seconds. Now using SmartBear's own documentation the same function is taking 3min+. Am I doing something wrong??
let counter = 0;
let logMethod = "Warning";
const ForReading = 1;
let FSObject = Sys.OleObject("Scripting.FileSystemObject");
let file = FSObject.OpenTextFile(ProjectSuite.Variables.FCINSTALLPATH+"\\Setup\\__createdb.log", ForReading);
while(! file.AtEndOfStream)
{
let lineToBeRead = file.ReadLine();
compare = lineToBeRead.search("ORA-");
if(compare > -1)
{
secureRole = lineToBeRead.search("28405");
if(secureRole == -1)
{
if(logMethod == "Errors" || logMethod == "errors")
Log.Error("Line " + counter +": " + lineToBeRead);
if(logMethod == "Warnings" || logMethod == "warnings")
Log.Warning("Line " + counter +": " + lineToBeRead);
}
else
{
Log.Message("Line " + counter +": " + lineToBeRead);
}
}
counter++;
}
file.Close();