Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ public class GitInfoProvider {
// in the same daemon is unlikely
private final DDCache<String, GitInfo> gitInfoCache = DDCaches.newFixedSizeCache(4);

// DQH - The lambda in getGitInfo was a hot allocation point, so
// pulled the lambda into a member variable to avoid constantly allocating.
final Function<String, GitInfo> buildGitInfoFn = this::buildGitInfo;

public GitInfo getGitInfo() {
return getGitInfo(null);
}
Expand All @@ -56,7 +60,7 @@ public GitInfo getGitInfo(@Nullable String repositoryPath) {
repositoryPath = NULL_PATH_STRING;
}

return gitInfoCache.computeIfAbsent(repositoryPath, this::buildGitInfo);
return gitInfoCache.computeIfAbsent(repositoryPath, buildGitInfoFn);
}

private GitInfo buildGitInfo(String repositoryPath) {
Expand Down