3 ms·
>First of all, the die function returns one sample at a time. It needs to be called N times to get N samples, which is slow. This sort of thing is why I find t
by asfdgadrhadfh 5y ago
>First of all, the die function returns one sample at a time. It needs to be called N times to get N samples, which is slow.
This sort of thing is why I find the love of Python utterly baffling. Yes, the syntax is initially clean, but behind the scenes it is a total mess. If you just write the obvious thing the performance will be disgraceful. I don't know of another language where the for loop is considered harmful. You have to turn it into a hacked-together array language to get Python to exploit even one percent of the machine's real capabilities.
It reminds me of writing TI BASIC back in high school, where the classroom mythology was that leaving off the ending parentheses made programs run faster.