500× faster: Four different ways to speed up your code

If your Python code is slow and needs to be fast, there are many
different approaches you can take, from parallelism to writing a
compiled extension. But if you just stick to one approach, it’s easy to
miss potential speedups, and end up with code that is much slower than
it could be.
To make sure you’re not forgetting potential sources of speed, it’s
useful to think in terms of practices. Each practice:
- Speeds up your code in its own unique way.
- Involves distinct skills and knowledge.
- Can be applied on its own.
- Can also be applied together with other practices for even more
speed.
To make this more concrete, in this article I’ll work through an example
where I will apply multiple practices. Specifically I’ll be
demonstrating