alemelis / Bobby.jl

A mediocre chess moves validator
MIT License
8 stars 1 forks source link

Bitboards should use tuples rather than lists #28

Closed oscardssmith closed 3 years ago

oscardssmith commented 3 years ago

This should be a pure performance win.

alemelis commented 3 years ago

thanks for the hint

are you referring to the moves list (or arrays in general)? https://github.com/alemelis/Bobby.jl/blob/2e1e8b27bd0a6c007c14ed681b73d868e1e1627e/src/structs.jl#L52-L54

oscardssmith commented 3 years ago

No. I meant things like lines 1-10 of king.jl (and for all the other magics). This matters because tuples are immutable, so lots more optimizations become valid by default.

alemelis commented 3 years ago

this is a good point

indeed I guess it would be beneficial to add some benchmarks to the repo so that all these improvements can be tracked

(by the way, PRs are welcome 🙂 )