excel-mapper icon indicating copy to clipboard operation
excel-mapper copied to clipboard

Performance: Read cells from the data reader with the property type

Open bocca opened this issue 3 years ago • 0 comments

IExcelDataReader supports reading values with the desired type. This can improve performance for boolean, numeric and date cells. A numeric cell in Excel is stored as a number, and can be read directly as number with, for example, reader.GetDecimal(). A DateTime cell in Excel is stored as a number, and can be read directly as DateTime with reader.GetDateTime(). But Excel Mapper always reads cell values as string. This "stringly-typed" aproach requires to format the value to string, and then parse the string to the property type, degrading performance. I suggest to read values from the data reader with the property type.

bocca avatar Aug 02 '22 15:08 bocca