RFR: 2340: CommitCommentsWorkItem executing in GitLab takes a lot of time
Zhao Song
zsong at openjdk.org
Fri Aug 9 22:24:44 UTC 2024
On Fri, 9 Aug 2024 22:05:37 GMT, Zhao Song <zsong at openjdk.org> wrote:
>> forge/src/main/java/org/openjdk/skara/forge/gitlab/GitLabRepository.java line 560:
>>
>>> 558: // eventually clear up on subsequent tries.
>>> 559: Optional<CommitComment> found = Optional.empty();
>>> 560: for (var candidate : candidates) {
>>
>> Are you sure this makes a difference? Streams, or at least flatMap, aren't supposed to be eager, so I was expecting the current implementation to do exactly the same thing.
>
> I am not sure what do you mean by eager. I think in the original implementation, it will retrieve all the commit comments before filtering, so with so many candidates, it's inefficient.
Ah, I did some tests, you are right, need to think more about it
-------------
PR Review Comment: https://git.openjdk.org/skara/pull/1682#discussion_r1712285914
More information about the skara-dev
mailing list