-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Excessive Arrays.fill in Java not necessary. #286
Comments
gangeli
pushed a commit
that referenced
this issue
Nov 6, 2016
I've removing all the ones that I can find, but that was < 20 (but > 15), so it must have been a quite exhaustive count! |
Awesome! I'll pull in the future here... I wonder if there are any static analysis tools that do a good job here. I will try to run findbugs when I get some time. Thanks! |
rocwzp
pushed a commit
to rocwzp/CoreNLP
that referenced
this issue
Dec 21, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is a lot of code in CoreNLP like the following:
I counted 10-20 in just 15 seconds by looking at the code by grepping for
Arrays.fill
This isn't needed as Java defaults to 0.0 for floats and doubles so this is just wasting time.
The only argument FOR it is if you're trying to force the RAM into a cache line but I don't see any commentary on this.
Otherwise it might be just wasting time.
If you're trying to force it into a cache line calling something like Cache.forceIntoCacheline (a new method) would be a better way to document this.
The text was updated successfully, but these errors were encountered: