I started to rewrite some of my solutions (Python 3) into Java also with an eye for performance. I think for most of the problems it’s easy, the python one runs in <30ms incl. startup already, one basically only needs to bring down the 5-10 “slow” ones, using a compiled language will take care of the rest. But I am not sure I’ll bring up the motivation to a) rewrite ALL ~45 solutions I have and b) finish the remaining ~4 and c) then speed them up…
Nice! It might be a fun thing to try next year. Writing quicker solutions in Java from the start I mean. Did you use any cool tricks to speed things up in Python?
While I was working on it, I did all in sequence, and didn’t want to revise solutions later. I didn’t know in advance whether a puzzle would be slow. That really motivated me to try and make everything as fast as possible from the beginning.
Smart as I am I changed values in a filed called unoptimized.txt as I went to speed it up..
But overall I resolved myself to not spend my whole spare time this year so I mostly went with “if it’s correct, it’s fine” and then whenever I had a few minutes spare I looked at the “slow” ones and gave ‘em a hard look how to improve execution time, but I wouldn’t say I really optimized it.
Pretty cool!
I started to rewrite some of my solutions (Python 3) into Java also with an eye for performance. I think for most of the problems it’s easy, the python one runs in <30ms incl. startup already, one basically only needs to bring down the 5-10 “slow” ones, using a compiled language will take care of the rest. But I am not sure I’ll bring up the motivation to a) rewrite ALL ~45 solutions I have and b) finish the remaining ~4 and c) then speed them up…
Nice! It might be a fun thing to try next year. Writing quicker solutions in Java from the start I mean. Did you use any cool tricks to speed things up in Python?
While I was working on it, I did all in sequence, and didn’t want to revise solutions later. I didn’t know in advance whether a puzzle would be slow. That really motivated me to try and make everything as fast as possible from the beginning.
Smart as I am I changed values in a filed called unoptimized.txt as I went to speed it up..
But overall I resolved myself to not spend my whole spare time this year so I mostly went with “if it’s correct, it’s fine” and then whenever I had a few minutes spare I looked at the “slow” ones and gave ‘em a hard look how to improve execution time, but I wouldn’t say I really optimized it.