When using (pseudo) random numbers in Jython, would it be more efficient to use the Python random module or Java’s random class?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Python’s version is much faster in a simple test on my Mac:
1000000 loops, best of 3: 0.266 usec per loop
vs
1000000 loops, best of 3: 1.65 usec per loop
Jython version 2.5b3 and Java version 1.5.0_19.