[ 
https://issues.apache.org/jira/browse/GROOVY-11596?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17939632#comment-17939632
 ] 

ASF GitHub Bot commented on GROOVY-11596:
-----------------------------------------

codecov-commenter commented on PR #2170:
URL: https://github.com/apache/groovy/pull/2170#issuecomment-2765866544

   ## 
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/2170?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 Report
   Attention: Patch coverage is `80.42328%` with `37 lines` in your changes 
missing coverage. Please review.
   > Project coverage is 68.8574%. Comparing base 
[(`6ce967f`)](https://app.codecov.io/gh/apache/groovy/commit/6ce967f8019f175e589e71873f025b0a16bb0a13?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 to head 
[(`8f0d51c`)](https://app.codecov.io/gh/apache/groovy/commit/8f0d51c577cd62e430692af40f861e77b700384f?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/2170?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Patch % | Lines |
   |---|---|---|
   | 
[.../codehaus/groovy/runtime/DefaultGroovyMethods.java](https://app.codecov.io/gh/apache/groovy/pull/2170?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fruntime%2FDefaultGroovyMethods.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3J1bnRpbWUvRGVmYXVsdEdyb292eU1ldGhvZHMuamF2YQ==)
 | 80.4233% | [20 Missing and 17 partials :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/2170?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   [![Impacted file tree 
graph](https://app.codecov.io/gh/apache/groovy/pull/2170/graphs/tree.svg?width=650&height=150&src=pr&token=1r45138NfQ&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)](https://app.codecov.io/gh/apache/groovy/pull/2170?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@                Coverage Diff                 @@
   ##               master      #2170        +/-   ##
   ==================================================
   + Coverage     68.8443%   68.8574%   +0.0131%     
   + Complexity      29533      29525         -8     
   ==================================================
     Files            1421       1421                
     Lines          113424     113552       +128     
     Branches        19644      19668        +24     
   ==================================================
   + Hits            78086      78189       +103     
   - Misses          28754      28771        +17     
   - Partials         6584       6592         +8     
   ```
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/2170?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Coverage Δ | |
   |---|---|---|
   | 
[.../codehaus/groovy/runtime/DefaultGroovyMethods.java](https://app.codecov.io/gh/apache/groovy/pull/2170?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fruntime%2FDefaultGroovyMethods.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3J1bnRpbWUvRGVmYXVsdEdyb292eU1ldGhvZHMuamF2YQ==)
 | `73.6776% <80.4233%> (+0.3508%)` | :arrow_up: |
   
   ... and [4 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/groovy/pull/2170/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   </details>
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test 
Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, 
report on failures, and find test suite problems.
   - :package: [JS Bundle 
Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save 
yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>




> Additional DGM lazy iterator methods
> ------------------------------------
>
>                 Key: GROOVY-11596
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11596
>             Project: Groovy
>          Issue Type: Improvement
>            Reporter: Paul King
>            Assignee: Paul King
>            Priority: Major
>
> This issue is to provide a few more iterator variants in the DGM methods. 
> Some of these methods already exist but have an eager implementation. Others 
> are inspired from [groovy-stream|https://timyates.github.io/groovy-stream/].
> Instead of being executing in multiple seconds, as is, the following code 
> executes in a few 10s of ms with the iterator line uncommented, and creates 
> much fewer intermediate collections.
> {code:groovy}
> assert (1..10000)
> //  .iterator()
>   .repeat(10000)
>   .take(20000000)
>   .takeWhile{ true }
>   .drop(5)
>   .toUnique()
>   .collate(2)
>   .flatten{ it * 2 }
>   .dropRight(1)
>   .dropWhile{ it < 15 }
>   .withIndex()
>   .init()
>   .take(5)
>   .injectAll([0, 0]){ a, b -> [a.first() + b.first(), a.last() + b.last()] }
>   .collect()
>   .toString() == '[[16, 0], [34, 1], [54, 3], [76, 6], [100, 10]]'
> {code}
> In the above example, the existing methods on iterators are: drop, init, 
> take, takeWhile, withIndex, dropRight, toUnique
> Existing methods on iterables only: collate, flatten
> Existing eager iterator methods: injectAll
> New methods: repeat (this is an alias for multiply when giving a count but 
> matches the groovy-stream name and makes more sense when using the infinite 
> count)
> This is continuing Groovy's support for stream-like functionality. You can 
> think of all Iterator DGM methods that return iterators as like intermediate 
> operators. The methods on Iterator which return other things are like 
> collector operators, e.g. collect*, any, average, count, find*, inject, etc.
> Groovy-stream has much further functionality we could look at:
> * concat/plus on iterators
> * faux list comprehension variant of cross-product
> * filter/map/flatMap which we could implement just on iterators and 
> effectively provide intermediate variants for findAll/collect/collectMany
> * various tap methods we could implement on iterators



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to