Question
Multiplication of huge massive of numbers in python
I'm working on a small python program for myself and I need an algorithm for fast multiplication of a huge array with numbers (over 660 000 numbers, each is 9 digits). The result number is over 4 millions digits. Currently I'm using math.prod, which calculates it in ~10 minutes, but that's too slow, especially if I want to increase amount of numbers.
I checked some algorithms for faster multiplications, for example Schönhage–Strassen algorithm and Toom–Cook multiplication, but I didn't understand how they works or how to make them. I tried some versions that I've found on the internet, but they're not working too well and are even slower. I wonder if someone knows how to multiplicate these amounts of numbers faster, or could explain how to use some math to do this?