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

Removed instances of String.format to help funcotator performance #7370

Merged
merged 4 commits into from Jul 27, 2021

Conversation

haileypfox
Copy link
Contributor

resolves #6574

@gatk-bot
Copy link

gatk-bot commented Jul 26, 2021

Travis reported job failures from build 35151
Failures in the following jobs:

Test Type JDK Job ID Logs
unit openjdk11 35151.13 logs
integration openjdk11 35151.12 logs
unit openjdk8 35151.3 logs
integration openjdk8 35151.2 logs

@gatk-bot
Copy link

gatk-bot commented Jul 27, 2021

Travis reported job failures from build 35162
Failures in the following jobs:

Test Type JDK Job ID Logs
unit openjdk11 35162.13 logs
integration openjdk11 35162.12 logs
unit openjdk8 35162.3 logs
integration openjdk8 35162.2 logs

Copy link
Collaborator

@jonn-smith jonn-smith left a comment

Choose a reason for hiding this comment

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

Looks great - just a couple minor things.

@@ -13,6 +13,7 @@
import java.util.LinkedHashSet;
import java.util.List;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like this import was added but isn't needed. Can you remove it?

.collect(Collectors.toList());
final List<String> cleanLetters = new ArrayList<>();
for(String s: badLetters) {
String hex = Integer.toHexString(s.getBytes(StandardCharsets.US_ASCII)[0] & 0xFF).toUpperCase();
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is great, but I think you can simplify it into an if statement with one assignment in each branch:

if (s.getBytes(StandardCharsets.US_ASCII)[0] < 16) {
    // Need to add leading zero
}
else {
    // straight conversion
}

Then you can do one assignment (with a couple of + operations) in each of those conditions.

@jonn-smith jonn-smith merged commit b4cba37 into master Jul 27, 2021
@jonn-smith jonn-smith deleted the hf_speedregression branch July 27, 2021 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Funcotator Speed Regression
3 participants