Pushing to list becomes slow with large lists

I noticed that after generating very large lists, pushing anything to the list becomes slow. If I have 10 items in a list, pushing 1 more is very fast, but when I have 6000 items in a list, pushing 1 more becomes really slow.

Obviously you’ll rarely need to make that big a list in practice, but this makes it so that generating large lists gets exponentially slow the larger the list is (instead of linearly, which is what I would expect). If I’m generating lists based on user input, this might cause problems. Not sure if it’s expected behavior, but to my untrained eye it seems like something that could be optimized, i.e. I would expect adding one more item to a list to take the same amount of time no matter how big the list is.

list_creation_speed_test.rev


push slow small.mov