komarovalexander / ka-table

Lightweight MIT React Table component with Sorting, Filtering, Grouping, Virtualization, Editing and many more
http://ka-table.com
MIT License
769 stars 56 forks source link

Performance improvement: column.dataType independent render #404

Closed komarovalexander closed 5 months ago

komarovalexander commented 5 months ago

403

this PR increases major version as convertToColumnTypes step was removed.

in previous versions convertToColumnTypes is used to check and convert all cells data to correct dataType of the column. As a result this affected performance of the whole table.

in version 9.0.0 user should check that correct dataType is set in column, for example: '1' & 1 have different dataTypes starting for version 9.0.0. Column with value '1' - should has String dataType, 1 - should has Number dataType.

if data has a column with value '1' - and user need it to behave it as a number, then this value should be converted to Number before passing to data, and column dataType should set as Number.

Pros: Performance of the table is increased as no additional checks and conversions.

Cons: Users should care about dataTypes - but in most cases it is better to have more obvious behavior instead of having hidden conversion under the hood in the table