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/06/14 06:04:12 UTC

[GitHub] [skywalking] lkxiaolou commented on a change in pull request #2874: Rewrite AtomicRangeInteger for higher performance

lkxiaolou commented on a change in pull request #2874: Rewrite AtomicRangeInteger for higher performance
URL: https://github.com/apache/skywalking/pull/2874#discussion_r293668848
 
 

 ##########
 File path: apm-commons/apm-datacarrier/src/test/java/org/apache/skywalking/apm/commons/datacarrier/common/AtomicRangeIntegerTest.java
 ##########
 @@ -39,4 +48,95 @@ public void testGetAndIncrement() {
         Assert.assertEquals(1, (int)atomicI.floatValue());
         Assert.assertEquals(1, (int)atomicI.doubleValue());
     }
+
+    @Test
+    @Benchmark
+    public void testOriGetAndIncrementPerformance() {
+        ATOMIC_ORI.oriGetAndIncrement();
+    }
+
+    @Test
+    @Benchmark
+    public void testNewGetAndIncrementPerformance() {
+        ATOMIC_NEW.getAndIncrement();
+    }
+
+    public static void main(String[] args) throws RunnerException {
+        Options opt = new OptionsBuilder()
+                .include(AtomicRangeIntegerTest.class.getSimpleName())
+                .forks(1)
+                .threads(4)
+                .output("/tmp/jmh.log")
+                .warmupIterations(0)
 
 Review comment:
   I have added, and add syncIterations false.

----------------------------------------------------------------
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