< prev index next >

test/micro/org/openjdk/bench/jdk/incubator/foreign/ParallelSum.java

Print this page
*** 22,13 ***
   */
  
  package org.openjdk.bench.jdk.incubator.foreign;
  
  import jdk.incubator.foreign.MemoryLayout;
- import jdk.incubator.foreign.MemoryLayouts;
  import jdk.incubator.foreign.ResourceScope;
  import jdk.incubator.foreign.SequenceLayout;
  import sun.misc.Unsafe;
  import org.openjdk.jmh.annotations.Benchmark;
  import org.openjdk.jmh.annotations.BenchmarkMode;
  import org.openjdk.jmh.annotations.Fork;
  import org.openjdk.jmh.annotations.Measurement;
--- 22,13 ---
   */
  
  package org.openjdk.bench.jdk.incubator.foreign;
  
  import jdk.incubator.foreign.MemoryLayout;
  import jdk.incubator.foreign.ResourceScope;
  import jdk.incubator.foreign.SequenceLayout;
+ import jdk.incubator.foreign.ValueLayout;
  import sun.misc.Unsafe;
  import org.openjdk.jmh.annotations.Benchmark;
  import org.openjdk.jmh.annotations.BenchmarkMode;
  import org.openjdk.jmh.annotations.Fork;
  import org.openjdk.jmh.annotations.Measurement;

*** 50,11 ***
  import java.util.concurrent.TimeUnit;
  import java.util.function.Predicate;
  import java.util.function.ToIntFunction;
  
  import static jdk.incubator.foreign.MemoryLayout.PathElement.sequenceElement;
! import static jdk.incubator.foreign.MemoryLayouts.JAVA_INT;
  
  @BenchmarkMode(Mode.AverageTime)
  @Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS)
  @Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
  @State(org.openjdk.jmh.annotations.Scope.Thread)
--- 50,11 ---
  import java.util.concurrent.TimeUnit;
  import java.util.function.Predicate;
  import java.util.function.ToIntFunction;
  
  import static jdk.incubator.foreign.MemoryLayout.PathElement.sequenceElement;
! import static jdk.incubator.foreign.ValueLayout.JAVA_INT;
  
  @BenchmarkMode(Mode.AverageTime)
  @Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS)
  @Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
  @State(org.openjdk.jmh.annotations.Scope.Thread)

*** 63,13 ***
  public class ParallelSum {
  
      final static int CARRIER_SIZE = 4;
      final static int ALLOC_SIZE = CARRIER_SIZE * 1024 * 1024 * 256;
      final static int ELEM_SIZE = ALLOC_SIZE / CARRIER_SIZE;
!     static final VarHandle VH_int = MemoryLayout.sequenceLayout(JAVA_INT).varHandle(int.class, sequenceElement());
  
!     final static MemoryLayout ELEM_LAYOUT = MemoryLayouts.JAVA_INT;
      final static int BULK_FACTOR = 512;
      final static SequenceLayout ELEM_LAYOUT_BULK = MemoryLayout.sequenceLayout(BULK_FACTOR, ELEM_LAYOUT);
  
      static final Unsafe unsafe = Utils.unsafe;
  
--- 63,13 ---
  public class ParallelSum {
  
      final static int CARRIER_SIZE = 4;
      final static int ALLOC_SIZE = CARRIER_SIZE * 1024 * 1024 * 256;
      final static int ELEM_SIZE = ALLOC_SIZE / CARRIER_SIZE;
!     static final VarHandle VH_int = MemoryLayout.sequenceLayout(JAVA_INT).varHandle(sequenceElement());
  
!     final static MemoryLayout ELEM_LAYOUT = ValueLayout.JAVA_INT;
      final static int BULK_FACTOR = 512;
      final static SequenceLayout ELEM_LAYOUT_BULK = MemoryLayout.sequenceLayout(BULK_FACTOR, ELEM_LAYOUT);
  
      static final Unsafe unsafe = Utils.unsafe;
  
< prev index next >