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

Performance and memory is becoming a problem #10

Open
icecream17 opened this issue Jan 27, 2021 · 6 comments
Open

Performance and memory is becoming a problem #10

icecream17 opened this issue Jan 27, 2021 · 6 comments
Labels
problem Between a bug and an enhancement slightly ajar Almost closed

Comments

@icecream17
Copy link
Owner

While running the tournament "avoider" played against itself....
image

...and it's soooo slow to update. Update takes soooo long.

@icecream17
Copy link
Owner Author

This probably is a combination of:

  • Code updating the board more slowly because of all the squares, moveHistory, and gameStates
  • Code picking a move more slowly because of all the squares, moveHistory, gameStates
  • setTimeout throttling in the async pause function

Eventually in the tournament there's an "Aw, Snap!" (Error 64000) [Google ran out of memory while trying to display the webpage]

@icecream17 icecream17 changed the title After many turns the game slows down Performance and memory is becoming a problem Jan 28, 2021
@icecream17
Copy link
Owner Author

image
Example

@icecream17
Copy link
Owner Author

icecream17 commented Feb 3, 2021

@icecream17
Copy link
Owner Author

Starting memory: 24 MB
After waiting awhile: 21.4 MB (hooray chrome optimization)
After 20 turns: 22.2 MB
After click "reset game": 22.3 MB
After 101 moves: 51.7 MB

21.4 --> 22.2 after 20 turns (rate = 0.04 MB per turn)
22.3 --> 51.7 after 101 turns (rate = 0.29 MB per turn)

The most memory is probably spent with gameStates and moveHistory

@icecream17
Copy link
Owner Author

Starting with commit fad25cf,
and ending with commit b50d235,
after 175 moves the memory is still at 48 MB

@icecream17
Copy link
Owner Author

Google says that 15 tabs can take up to
1 GB to 2 GB.

So 67 MB to 133 MB
After 1 whole tournament it's 72.7 MB. Pretty good. This will still be open though.

@icecream17 icecream17 added this to Issues in Tic tac toe grow Feb 10, 2021
@icecream17 icecream17 added problem Between a bug and an enhancement slightly ajar Almost closed labels Feb 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
problem Between a bug and an enhancement slightly ajar Almost closed
Projects
Development

No branches or pull requests

1 participant