Use CopyOnWriteArrayList instead of recreating manually#3106
Use CopyOnWriteArrayList instead of recreating manually#3106kezhenxu94 wants to merge 3 commits into
Conversation
|
FYI @wu-sheng , I'm recently considering whether we should create a new module/directory to place all the benchmark tests like other projects, the reasons are:
Just a bold thought and may make no sense at all :) |
|
@kezhenxu94 How about we create WIKI pages for that? And link to the PRs? |
|
We have this. https://cwiki.apache.org/confluence/display/SKYWALKING/Home I could grant committers access right. Then all the acceptable performance improvement PRs, should have a benchmark list there. |
That's a great alternative, it would be easy for new-comers who are interested in performance optimization and can refer to the wiki |
|
Out of this patch. |
wu-sheng
left a comment
There was a problem hiding this comment.
Is this really performance concern? This never changes in runtime, right?
|
We accept a lot of performance improvements these days, but we don't need to focus on that too much. |
|
Like I said in some other PRs, we don't require people to change their coding style, due to that is personal interests. It is only acceptable when causing runtime performance issue. |
|
Yes. In this case, it is more importance to fix |
Please answer these questions before submitting pull request
skywalking/apm-commons/apm-datacarrier/src/main/java/org/apache/skywalking/apm/commons/datacarrier/consumer/MultipleChannelsConsumer.java
Lines 99 to 109 in 8faa356
the comment
// Recreate the new list to avoid change list while the list is used in consuming.reminds me of theCopyOnWritedata structure that is perfectly suitable to this scenario, although the methodaddNewTargetis not frequently invoked, I did a simple benchmark out of curiosity.This patch also fixes that the non-atomic operation
+=on thevolatilevariablesize