You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2019/07/17 04:00:39 UTC
[GitHub] [skywalking] kezhenxu94 commented on a change in pull request
#3093: Using ArrayList to instead of LinkedList
kezhenxu94 commented on a change in pull request #3093: Using ArrayList to instead of LinkedList
URL: https://github.com/apache/skywalking/pull/3093#discussion_r304211529
##########
File path: apm-commons/apm-datacarrier/src/main/java/org/apache/skywalking/apm/commons/datacarrier/consumer/MultipleChannelsConsumer.java
##########
@@ -43,10 +46,11 @@ public MultipleChannelsConsumer(String threadName, long consumeCycle) {
public void run() {
running = true;
+ final List consumeList = new ArrayList(2000);
while (running) {
boolean hasData = false;
for (Group target : consumeTargets) {
- hasData = hasData || consume(target);
+ hasData |= consume(target, consumeList);
Review comment:
> They are the same here, right?
Not realy, it's `short circuit` operation (`consume` won't be called if `hasData == true`) before your changes and the `consume` would always be called after your changes
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services