I was solving [AoC Day 21](http://adventofcode.com/2017/day/21), which for part 
B asks you to run 18 iterations.

First I've made Python/numpy solution (runs in 0.40 sec), which scales nicely 
even to 24 iterations (runs in ~16 sec).

My [Nim 
solution](https://gist.github.com/anonymous/bc528ced2cb4faeede915f1f8d0211ee) 
runs 18 iterations in 0.14 sec, but 24 iterations take ~8 sec.

Here is the 
[input](https://gist.github.com/anonymous/795715d5f5263565b83733993bb1002f).

\---

I'm Nim beginner so I'm think I could get speedup and better scaling if I maybe 
use some other data structure (perhaps arrays? I couldn't have proc's return 
type to be openArray, so I decided to use seqs).

Do you have any ideas how to speed this up?

Reply via email to