Open Alex-Sichkar opened 5 years ago
@ygwain I did not write the sorting logic of TableListData
myself, so I am am not aware of the reasons for this particular implementation. You are welcome to open a PR with a better performing implementation as long as the functionality is still the same.
I have a list with about 1000 objects and sort them by attribute that returns a tuple of some data. Sorting by that attribute takes about 100ms. If I sort the list myself like:
it takes about 25ms. As I understand overhead happens because django-table2 wraps each object in Comparator class. Some info about it: https://stackoverflow.com/questions/34455594/why-is-sorting-a-python-list-of-tuples-faster-when-i-explicitly-provide-the-key