Thanks for the tips! Unfortunately for the current challenge, I ran out of time to try to speed it up much, but this will be useful in the future.
I wasted a lot of time experimenting and getting some modest speedups, and then had a mad panic to add all the missing stuff to make my entry into an actual game. Hey ho.