Open masak opened 2 years ago
I just created and ran a version of the code without the for
loops but with all the rest of the code. It does indeed take 25 minutes. I'm now a little bit curious what it is that takes such time...
nchar
callsboard
lookupsI made yet another version without these two, and that takes 1.6 seconds. So, yeah. Slow.
When I put back the nchar
calls, I get 46 seconds. Which would assign ~24 minutes to the board
lookups.
Looking into #200 for evidence of the slowness of arrays, I found a similar comment I had made about four months ago. But back then I wasn't using arrays, so I mostly got the three-minute slowdown of for
loops.
Onwards towards faster programs!
I wrote the following straightforward code that prints a chessboard:
Guess how long it takes to run? 28 minutes!
Just now I also created a version of the script containing only the
for
loops. I'm running it now, timing it. The fact that I'm still typing these words as it continues to run shows how unacceptably slowfor
is right now.I don't foresee any big issue in creating a fast operative for
for
. #412 doesn't mention it among the ones it decides to skip because it's hard.Ah, here:
Three minutes. Yes, that would still be a really nice time win. Seems that would still leave 25 minutes for my hex board, but at least it wouldn't be the
for
loops' fault.