bupticybee / TexasSolver

🚀 A very efficient Texas Holdem GTO solver :spades::hearts::clubs::diamonds:
https://bupticybee.github.io/texassolver_page
GNU Affero General Public License v3.0
1.69k stars 301 forks source link

compress table file #94

Closed yffbit closed 2 years ago

yffbit commented 2 years ago

The strength of 5 cards is determined by suit distribution and rank distribution. For the offsuit combination, we only need rank distribution. So we need two hash tables. One for suited combination, use cards mask as key. One for offsuit combination, use rank distribution mask as key. In this way, number of records reduced from 2598960 to 5148+6175=11323, from 376992 to 504+1278=1782, respectively.

bupticybee commented 2 years ago

This is very interesting, I will spend some time veryfying it and do some tests. Did you do some benchmarking? How does this change affect the speed of the solver and accuracy?

bupticybee commented 2 years ago

If I underestand this correctly, this change mainly affects the loading speed,right? So it does not change the solving speed and accuracy?

yffbit commented 2 years ago

Yes. It speeds up the loading process and saves some memory. It doesn't change the cfr process.

bupticybee commented 2 years ago

Yes. It speeds up the loading process and saves some memory. It doesn't change the cfr process.

Okay I see. I will do some test first. Thanks very much for your effort.

bupticybee commented 2 years ago

Hi, I read the code, is it possible to make the new bin file normal txt file? I think it would not hurt the performance much, and would be much easier for any other developer to reuse in other languages.

yffbit commented 2 years ago

Hi, I read the code, is it possible to make the new bin file normal txt file? I think it would not hurt the performance much, and would be much easier for any other developer to reuse in other languages.

To generate normal text file, just change the implementation of save() and load() function as you want.

bupticybee commented 2 years ago

Hi, I read the code, is it possible to make the new bin file normal txt file? I think it would not hurt the performance much, and would be much easier for any other developer to reuse in other languages.

To generate normal text file, just change the implementation of save() and load() function as you want.

Aha, I see that.

bupticybee commented 2 years ago

Merged to gui brach, after tests are complete will merge this to master.

bupticybee commented 2 years ago

UPDATE: I have done some slight modification to the code and now it works prefectly on mac. It did speed up the loading process a lot and seem didn't change the speed or accuracy. Great work. Will transfer the code to linux branch after some futher checks. Thanks for the effort!