Skip to content

Performance issue with DataRow in 7.3.4 #433

@rouvian

Description

@rouvian

Here is a sample script which accesses a DataRow

var ds = server.ExecuteDataSet(context.connectionString, context.queryText, context);

var dt = ds.Tables(0);
var drs = dt.Rows;

for(var i = 0; i < drs.Count; i++) {
    var dr = drs(i);
    var value = dr(0);
    logger.LogMessage(MessageType.Information, value, "");
}

The line value = dr(0) cause OperationCanceledException which is caught internally. However, this causes a big performance issue in the loop. The issue is in TypeHelpers.cs in the source code of ClearScript:

if (argIndex >= args.Length)
{
    if (!param.IsOptional && !param.HasDefaultValue)
    {
        throw new OperationCanceledException();
    }

    continue;
}

The same issue does not occur in 7.3.1.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions