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

Refactored random + memory #11

Merged
merged 14 commits into from
Dec 27, 2023
Merged

Refactored random + memory #11

merged 14 commits into from
Dec 27, 2023

Conversation

Duzzuti
Copy link
Owner

@Duzzuti Duzzuti commented Dec 24, 2023

resolves #7

Heap allocated memory is now stack allocated
random is used like the issue suggests
@Duzzuti Duzzuti self-assigned this Dec 24, 2023
@Duzzuti Duzzuti linked an issue Dec 24, 2023 that may be closed by this pull request
@Duzzuti
Copy link
Owner Author

Duzzuti commented Dec 24, 2023

We could improve performance of the static card getters by 150x and decrease memory size of a deck object by 99%

@Duzzuti
Copy link
Owner Author

Duzzuti commented Dec 26, 2023

should add smart pointer if practical

@Duzzuti
Copy link
Owner Author

Duzzuti commented Dec 26, 2023

Heavily improved performance.
Without logs, we get
10-15ms per 10 Games (down from 2sec)
only 6 heap allocs (down from over 50K)

@Duzzuti Duzzuti marked this pull request as ready for review December 27, 2023 13:08
@Duzzuti Duzzuti merged commit 96781dc into main Dec 27, 2023
7 checks passed
@Duzzuti Duzzuti deleted the 10-refactor-random-usage branch December 27, 2023 13:08
@Duzzuti Duzzuti restored the 10-refactor-random-usage branch December 29, 2023 16:32
@Duzzuti Duzzuti deleted the 10-refactor-random-usage branch December 29, 2023 16:32
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

Successfully merging this pull request may close these issues.

Refactor random usage and memory management shufflePlayers() is stupid
1 participant