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 save - Replace instances of Math.Random with Random.nextD… #11

Closed
wants to merge 1 commit into from

Conversation

bd2019us
Copy link

@bd2019us bd2019us commented May 10, 2019

…ouble

SYNAPSE-1102 Performance save - Replace instances of Math.Random with Random.nextDouble. Some slight performance can be saved when replacing Math.random with Random.nextDouble, due to Math.random not having to create an instance of Random.

@isudana
Copy link
Contributor

isudana commented Nov 19, 2019

There is no conclusive fact to claim that using Random.nextDouble() gives a significant performance gain over Math.Random().
I found the following resources, but those are not good enough to make a drastic change in the codebase.
https://stackoverflow.com/questions/738629/math-random-versus-random-nextintint
https://community.oracle.com/message/6596485?#6594485

Do you have any other resources or proof to prove that we could gain a performance improvement by doing this change?

@isudana isudana closed this Nov 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants