Datatable sort is slow if column has few values

In a large datatable with approximately 5000 rows, I notice sort performance is very slow if the column has many empty values, specifically for “string” sort. For columns that require a value like name for example, the sort is very fast.

Not sure if this is a known behavior, just wanted to point it out.

Datatable sorting uses a standard Array.sort() in the background. Also, to ensure a string type each value is processed by .toString().toLowerCase(), which may cause a slowdown with “empty” values, but it should not be that significant.

Could you please provide a sample of the issue?

@Helga actually, I was testing on a very slow machine running on electron. You are right, when I tested on my development machine, I could not notice a difference.