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

Refactor random usage and memory management #10

Closed
Duzzuti opened this issue Dec 24, 2023 · 0 comments · Fixed by #11
Closed

Refactor random usage and memory management #10

Duzzuti opened this issue Dec 24, 2023 · 0 comments · Fixed by #11
Assignees
Labels
enhancement New feature or request testing anything related to testing

Comments

@Duzzuti
Copy link
Owner

Duzzuti commented Dec 24, 2023

instead of using slow and memory-hungry distributions (deck is 10kB, instead of 105Bytes), we can use std::rand and std::random_shuffle in combination with std::srand(). srand() is called once in main and we can use all other random methods.

Also there should be tests for entropy of these methods.

Moreover heap usage should be minimalized. We dont need to allocate heap memory for a 104Bytes array (deck)

This will be benefical for performance and memory as well as readability.

@Duzzuti Duzzuti added enhancement New feature or request testing anything related to testing labels Dec 24, 2023
@Duzzuti Duzzuti self-assigned this Dec 24, 2023
@Duzzuti Duzzuti changed the title Refactor random usage Refactor random usage and memory management Dec 24, 2023
@Duzzuti Duzzuti linked a pull request Dec 24, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request testing anything related to testing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant