Github user asdf2014 commented on a diff in the pull request:

    https://github.com/apache/eagle/pull/925#discussion_r114278551
  
    --- Diff: 
eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/publisher/impl/AlertEagleStorePlugin.java
 ---
    @@ -62,10 +60,9 @@ public void onAlert(AlertStreamEvent event) throws 
Exception {
             if (eventList == null || eventList.isEmpty()) {
                 return;
             }
    -        List<AlertPublishEvent> alertEvents = new ArrayList<>();
    -        for (AlertStreamEvent e : eventList) {
    -            alertEvents.add(AlertPublishEvent.createAlertPublishEvent(e));
    -        }
    +        List<AlertPublishEvent> alertEvents = eventList.stream().map(
    --- End diff --
    
    I have created a non-professional benchmark 
[test](https://github.com/asdf2014/yuzhouwan/blob/master/yuzhouwan-hacker/src/main/java/com/yuzhouwan/hacker/lambda/StreamPerformance.java#L19).
 After adding `-Xmx2G -Xms2G -Xmn1G -XX:+AlwaysPreTouch` params for reducing 
the impact from jvm resources, then found the performance gap is not very 
large, and the performance of `lambda stream` is better than `simple for loop` 
after the data becomes larger.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to