RFR: 2340: CommitCommentsWorkItem executing in GitLab takes a lot of time [v2]

Zhao Song zsong at openjdk.org
Mon Aug 12 22:44:11 UTC 2024


On Mon, 12 Aug 2024 22:08:39 GMT, Erik Joelsson <erikj at openjdk.org> wrote:

>> Zhao Song has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision:
>> 
>>   SKARA-2340
>
> forge/src/main/java/org/openjdk/skara/forge/gitlab/GitLabRepository.java line 645:
> 
>> 643:             var hash = new Hash(commit.get("id").asString());
>> 644:             var title = commit.get("title").asString();
>> 645:             tempCommitTitleToCommits.computeIfAbsent(title, t -> new LinkedHashSet<>()).add(hash);
> 
> I read the bug description and I think I understand the problem now. The initial creation of the map iterates commits from newest to oldest, while this loop iterates from oldest to newest.
> 
> Instead of creating a temporary map, couldn't we just call `LinkedHashSet::addFirst` to get the new commits added at the front in the correct order?

Yes, it's better to use `LinkedHashSet::addFirst`

-------------

PR Review Comment: https://git.openjdk.org/skara/pull/1682#discussion_r1714441173


More information about the skara-dev mailing list