31 ms·
All this reminds me of writing a Go (the board game) engine in Python. There's a lot of looping involved to identify groups and their liberties, and to detect K
by Buttons840 3y ago
All this reminds me of writing a Go (the board game) engine in Python. There's a lot of looping involved to identify groups and their liberties, and to detect Kos, etc. I profiled my Python code and optimized the algorithm, and it was faster. Then I rewrote my Python "Board" class in Rust and called it from the rest of my Python code, and it was faster again.
Then I wrote the same algorithms in Julia, and it was as fast as the Python / Rust solution. Then I learned that Julia lives up to its claim.
If you're reaching for Numpy / Pandas as an optimization, and not as a convenience, then consider rewriting your code in Julia.