Datatable sort is slow if column has few values

edited April 27 in Technical questions

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.


  • edited May 14

    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.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion