2021-10 Py: switch to using collections.deque

By switching the lists I was using as stacks out with a deque, I
appear to have achieved a teeeensy speed improvement.

List `append()` and `pop()` methods have at most a O(n) time
complexity, where deques have a O(1) time complexity.

https://docs.python.org/3/library/collections.html#collections.deque

Signed-off-by: AKU <tom@tdpain.net>
This commit is contained in:
akp 2021-12-10 16:31:42 +00:00
parent c55c9839e2
commit a60facbf55
No known key found for this signature in database
GPG key ID: AA5726202C8879B7
3 changed files with 9 additions and 8 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Before After
Before After