Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash? #1

Closed
therealOri opened this issue Feb 11, 2022 · 2 comments
Closed

Crash? #1

therealOri opened this issue Feb 11, 2022 · 2 comments

Comments

@therealOri
Copy link

Running the wordle.py file with a larger wordlist. 3b1b's 12k word list to be precise. Will make its way to 63% and then my computer freezes and then the terminal kills what's running and it stops.

(wdlENV) [ori@orio Wordle-Bot]$ python wordle.py

 63%|█████████████████████████████████████████████▋                          | 8226/12972 [04:43<07:08, 11.07it/s]
Killed

(wdlENV) [ori@orio Wordle-Bot]$ 

No idea as to why this happens but it does...

@GillesVandewiele
Copy link
Owner

GillesVandewiele commented Feb 11, 2022

How much RAM memory do you have? The code is not really optimized in terms of memory (or optimized in any terms at all), so after doing a quick run here on the word list of 3b1b, you might need around 10-12 gigs of memory.

A (slight) fix from the top of my head: the dictionary representation could be done much more efficiently. Currently we use 5 integers for every possible combination (and there are 3**5 or 243 of them). So roughly 250*5 integers, let's say 4 bytes each, which means 5000 bytes per word. Just replacing those 5 integers by a string of 5 characters requires only 1250 bytes and cuts down memory usage by 4 (i.e. (0, 1, 2, 0, 1) becomes '01201')

@therealOri
Copy link
Author

How much RAM memory do you have? The code is not really optimized in terms of memory (or optimized in any terms at all), so after doing a quick run here on the word list of 3b1b, you might need around 10-12 gigs of memory.

A (slight) fix from the top of my head: the dictionary representation could be done much more efficiently. Currently we use 5 integers for every possible combination (and there are 3**5 or 243 of them). So roughly 250*5 integers, let's say 4 bytes each, which means 5000 bytes per word. Just replacing those 5 integers by a string of 5 characters requires only 1250 bytes and cuts down memory usage by 4 (i.e. (0, 1, 2, 0, 1) becomes '01201')

Ah, ok.

And I have 8GBs of RAM. So RIP lol.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants