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

Use ThreadLocalRandom vs Math.random #16

Merged
merged 2 commits into from
Nov 13, 2017

Conversation

jasonculverhouse
Copy link
Contributor

There is an atomic compare and set loop in Math.random that can cause performance issues.

You can find many postings on the performance aspects of this change
http://blog.anvard.org/articles/2014/01/12/concurrent-random.html

This change requires a minimum version change from Java 1.6 to 1.7

There is an atomic compare and set loop in `Math.random` that can cause performance issues.

You can find many postings on the performance aspects of this change
http://blog.anvard.org/articles/2014/01/12/concurrent-random.html

This change requires a minimum version change from Java 1.6 to 1.7
@masci masci added this to the Future milestone Oct 12, 2016
@robinst
Copy link
Contributor

robinst commented Jul 5, 2017

@jasonculverhouse The travis build failed because it's building against openjdk6: https://travis-ci.org/DataDog/java-dogstatsd-client/builds/165588084

If you update the PR to remove this line, it will probably succeed: https://github.com/DataDog/java-dogstatsd-client/blob/master/.travis.yml#L6

@masci That raises the question of whether Java 6 should still be supported. Given that it has been EOL for some time now, I think it can be safely removed. What do you think?

@jasonculverhouse
Copy link
Contributor Author

@robinst You version your client. I don't see any issue with making the newer version work with java 7+

@robinst
Copy link
Contributor

robinst commented Jul 6, 2017

@jasonculverhouse I agree. I was just asking @masci's input as well. So, on your branch, can you remove the openjdk6 line from .travis.yml?

You can do it online, click edit here and remove the line: https://github.com/jasonculverhouse/java-dogstatsd-client/blob/jason/threadLocalRandom/.travis.yml

That would bring the PR into a mergable state.

@robinst
Copy link
Contributor

robinst commented Jul 7, 2017

Thanks, all green now! Now we just need a maintainer to merge this.

@ctoestreich
Copy link

I am wondering if there actually is a maintainer....

@masci
Copy link
Contributor

masci commented Nov 10, 2017

@ctoestreich there's a maintainer indeed, problem is he's not maintaining - that's me :(

I owe an apologies to all the contributors (whether it's code or feedback), will work on the opened PRs next week and try to make a release.

Thanks everyone for your patience!

@masci masci self-assigned this Nov 10, 2017
@masci masci modified the milestones: Future, 2.4 Nov 13, 2017
Copy link
Contributor

@masci masci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Ok to drop support for Java6.

@masci masci merged commit f548209 into DataDog:master Nov 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants