sorts
sorts copied to clipboard
Animation Speed
This sorting visualiser using Matplotlib is very simple to understand. This is good. However, I noticed that when the number of items in the list grows starting from 300 onwards, the performance drop becomes more significant. One thing I notice is that the animation update is inefficient:
def update_fig(A, rects, iteration):
for rect, val in zip(rects, A):
rect.set_height(val)
Is there a solution to make the update fast? Or is the performance bottleneck somewhere else?