Saturday, 29 July 2023

Can you have a progress bar for sorting a list?

I have a list containing ~50k elements of a custom data type (the latter is probably not important for my question) I'm sorting the list using pythons builtin list.sort() method.

myList: List[Foo] = ...
myList.sort(key=Foo.x)

Since the sorting takes a couple of minutes, I would like to have a progress bar for the sorting process. I haven't found any solutions online.

Is this even possible? I'm aware sorting algorithms may be complex and it might not be possible to measure the sorting progress at all. However, it would be fine for my usecase to have a "rough" measurement, like 25%, 50%, 75%...



from Can you have a progress bar for sorting a list?

No comments:

Post a Comment