CsvHelper icon indicating copy to clipboard operation
CsvHelper copied to clipboard

Fetching ~2700 columns with GetRecord<dynamic> taking >7s

Open Tak1za opened this issue 2 years ago • 1 comments

Describe the bug When I am fetching 1 row with nearly 2700 columns from a csv file, it takes ~8 seconds to fetch that row. Is it expected to be this slow? If yes, are there any performance benchmarks that are done that can help me provide an explanation that it's the best this library can do?

To Reproduce Generate an excel with ~2700 columns and consume one row using GetRecord<dynamic>

using var reader = new StreamReader(newStream);
using var csvReader = new CsvReader(reader, config);
while (csvReader.Read())
{
    var stopwatch = Stopwatch.StartNew();
    var record = csvReader.GetRecord<dynamic>();
    logger.DebugLog(logParams, stopwatch.ElapsedMilliseconds, "done reading row");
    yield return record;
}

Tak1za avatar Sep 26 '23 06:09 Tak1za

Dynamic is very slow. I can probably do some work on it to speed it up.

JoshClose avatar Feb 29 '24 21:02 JoshClose