deus-x-mackina / poker

A Rust crate for evaluating poker hands
MIT License
12 stars 5 forks source link

[Performance] Range vs Range calculations seems very inefficent #4

Open ItalyToast opened 1 year ago

ItalyToast commented 1 year ago

I was just looking around in the code and spotted what looks like some inefficiencies. I've been doing some poker simulations before (not in rust though) and my first impression is that there is a lot of memory wasted with the introduction of the Meta enum, atleast for doing range vs range simulations where you only care about who wins the hand and nothing else. Also to correctly bench the eval function I would prepare a bunch of hands. With only one combination being benched we'll always be in cache and not encounter the reality of the tables being in a hashmap (1 extra indirection vs array).

If there is interest I can put some work in to get it fixed.