@Benchmark
 public void defaultGet(final Blackhole blackhole) {
   final Map<Integer, String> defaultMap = this.defaultMap;
   for (int index : indexes) {
     blackhole.consume(defaultMap.get(index));
   }
 }
 @Benchmark
 public void timeEntryIteration(Blackhole bh) {
   for (Iterator<java.util.Map.Entry<IValue, IValue>> iterator = testMap.entryIterator();
       iterator.hasNext(); ) {
     bh.consume(iterator.next());
   }
 }
  @Benchmark
  @BenchmarkMode(Mode.AverageTime)
  @OutputTimeUnit(TimeUnit.MICROSECONDS)
  public void queryMultiQueryableIndex(Blackhole blackhole) throws Exception {
    List<QueryRunner<Result<TimeseriesResultValue>>> singleSegmentRunners = Lists.newArrayList();
    QueryToolChest toolChest = factory.getToolchest();
    for (int i = 0; i < numSegments; i++) {
      String segmentName = "qIndex" + i;
      QueryRunner<Result<TimeseriesResultValue>> runner =
          QueryBenchmarkUtil.makeQueryRunner(
              factory, segmentName, new QueryableIndexSegment(segmentName, qIndexes.get(i)));
      singleSegmentRunners.add(toolChest.preMergeQueryDecoration(runner));
    }

    QueryRunner theRunner =
        toolChest.postMergeQueryDecoration(
            new FinalizeResultsQueryRunner<>(
                toolChest.mergeResults(factory.mergeRunners(executorService, singleSegmentRunners)),
                toolChest));

    Sequence<Result<TimeseriesResultValue>> queryResult =
        theRunner.run(query, Maps.<String, Object>newHashMap());
    List<Result<TimeseriesResultValue>> results =
        Sequences.toList(queryResult, Lists.<Result<TimeseriesResultValue>>newArrayList());

    for (Result<TimeseriesResultValue> result : results) {
      blackhole.consume(result);
    }
  }
 @Benchmark
 @OperationsPerInvocation(CACHED_NUMBERS_SIZE)
 public void timeInsertContained(Blackhole bh) {
   for (int i = 0; i < CACHED_NUMBERS_SIZE; i++) {
     bh.consume(testMap.put(cachedNumbers[i], cachedNumbers[i]));
   }
 }
 @Benchmark
 @OperationsPerInvocation(OPERATIONS_PER_INVOCATION)
 public final void nativeDecimals(MultiplyExactBenchmarkState state, Blackhole blackhole) {
   for (int i = 0; i < OPERATIONS_PER_INVOCATION; i++) {
     blackhole.consume(nativeDecimals(state, state.values[i]));
   }
 }
 @Benchmark
 @BenchmarkMode(Mode.Throughput)
 public Object ionReadArray1000_1(IapState state, Blackhole blackhole) {
   PojoArray1Boolean pojoArray1 = (PojoArray1Boolean) state.readerArray1.read(state.dest1000_1, 0);
   blackhole.consume(pojoArray1);
   return pojoArray1;
 }
Ejemplo n.º 7
0
 @Benchmark
 @OperationsPerInvocation(100_000)
 public void linkedListIteration(Blackhole blackhole) {
   for (Integer i : linkedList) {
     blackhole.consume(i);
   }
 }
Ejemplo n.º 8
0
 @Benchmark
 public void atomicLongFieldGetAndIncrement(
     VolatileLongFieldState state, Times repeat, Blackhole bh) {
   for (int i = 0; i < repeat.times; i++) {
     bh.consume(VolatileLongFieldState.UPDATER.getAndIncrement(state));
   }
 }
Ejemplo n.º 9
0
 @Benchmark
 public void atomicLongFieldCASSuccess(VolatileLongFieldState state, Times repeat, Blackhole bh) {
   state.value = 0L;
   for (long i = 0; i < repeat.times; i++) {
     bh.consume(VolatileLongFieldState.UPDATER.compareAndSet(state, i, i + 1));
   }
 }
 @Benchmark
 @BenchmarkMode(Mode.Throughput)
 public Object ionRead1_10(IapState state, Blackhole blackhole) {
   Pojo10Boolean pojo10 = (Pojo10Boolean) state.reader10.read(state.dest1_10, 0);
   blackhole.consume(pojo10);
   return pojo10;
 }
Ejemplo n.º 11
0
 @Benchmark
 public void atomicLongCASSuccess(AtomicLongState state, Times repeat, Blackhole bh) {
   state.value.set(0L);
   for (long i = 0; i < repeat.times; i++) {
     bh.consume(state.value.compareAndSet(i, i + 1));
   }
 }
 @Benchmark
 public void ourGet(final Blackhole blackhole) {
   final Map<Integer, String> ourMap = this.ourMap;
   for (int index : indexes) {
     blackhole.consume(ourMap.get(index));
   }
 }
 @Benchmark
 @OperationsPerInvocation(CACHED_NUMBERS_SIZE)
 public void timeRemoveKey(Blackhole bh) {
   for (int i = 0; i < CACHED_NUMBERS_SIZE; i++) {
     bh.consume(testMap.removeKey(cachedNumbers[i]));
   }
 }
Ejemplo n.º 14
0
 @Benchmark
 public void atomicLongCASCheckFailure(AtomicLongState state, Times repeat, Blackhole bh) {
   for (int i = 0; i < repeat.times; i++) {
     if (state.value.get() == 1L) {
       bh.consume(state.value.compareAndSet(1L, 2L));
     }
   }
 }
  @Override
  public void processEntity(com.badlogic.ashley.core.Entity e, float deltaTime) {
    PlainPosition pos = e.getComponent(PlainPosition.class);
    pos.x += 1;
    pos.y -= 1;

    voidness.consume(e);
  }
  @Override
  protected void process(Entity e) {
    PlainPosition pos = positionMapper.get(e);
    pos.x -= 1;
    pos.y += 1;

    voidness.consume(e);
  }
 @Benchmark
 public void defaultPut(final Blackhole blackhole) {
   final Map<Integer, String> ourMap = this.ourMap;
   final List<Integer> indexes = this.indexes;
   final List<String> values = this.values;
   for (int i = 0, n = indexes.size(); i < n; i++) {
     blackhole.consume(defaultMap.put(indexes.get(i), values.get(i)));
   }
 }
Ejemplo n.º 18
0
 @Benchmark
 public void atomicIntCASCheckSuccess(AtomicIntState state, Times repeat, Blackhole bh) {
   state.value.set(0);
   for (int i = 0; i < repeat.times; i++) {
     if (state.value.get() == i) {
       bh.consume(state.value.compareAndSet(i, i + 1));
     }
   }
 }
 @Benchmark
 @BenchmarkMode(Mode.Throughput)
 public Object cborRead1_1(JacksonState state, Blackhole blackhole) {
   try {
     Pojo1Boolean pojo1 = state.objectMapperCbor.readValue(state.bytesCbor1_1, Pojo1Boolean.class);
     blackhole.consume(pojo1);
     return pojo1;
   } catch (IOException e) {
     e.printStackTrace();
     return null;
   }
 }
 @Benchmark
 @BenchmarkMode(Mode.Throughput)
 public Object jsonRead1_10(JacksonState state, Blackhole blackhole) {
   try {
     Pojo10Boolean pojo10 = state.objectMapper.readValue(state.bytesJson1_10, Pojo10Boolean.class);
     blackhole.consume(pojo10);
     return pojo10;
   } catch (IOException e) {
     e.printStackTrace();
     return null;
   }
 }
 @Benchmark
 @BenchmarkMode(Mode.Throughput)
 public Object msgPackRead1000_1(JacksonState state, Blackhole blackhole) {
   try {
     PojoArray1Boolean pojoArray1 =
         state.objectMapperMsgPack.readValue(state.bytesMsgPack1000_1, PojoArray1Boolean.class);
     blackhole.consume(pojoArray1);
     return pojoArray1;
   } catch (IOException e) {
     e.printStackTrace();
     return null;
   }
 }
Ejemplo n.º 22
0
  @Benchmark
  public void addClearLocal(TheState state, Blackhole bh) {
    SubscriptionList csub = new SubscriptionList();
    Subscription[] values = state.values;

    for (int i = state.loop; i > 0; i--) {
      for (int j = values.length - 1; j >= 0; j--) {
        csub.add(values[j]);
      }
      csub.clear();
    }
    bh.consume(csub);
  }
  @Benchmark
  @BenchmarkMode(Mode.AverageTime)
  @OutputTimeUnit(TimeUnit.MICROSECONDS)
  public void querySingleQueryableIndex(Blackhole blackhole) throws Exception {
    final QueryRunner<Result<TimeseriesResultValue>> runner =
        QueryBenchmarkUtil.makeQueryRunner(
            factory, "qIndex", new QueryableIndexSegment("qIndex", qIndexes.get(0)));

    List<Result<TimeseriesResultValue>> results =
        TimeseriesBenchmark.runQuery(factory, runner, query);
    for (Result<TimeseriesResultValue> result : results) {
      blackhole.consume(result);
    }
  }
  @Benchmark
  @BenchmarkMode(Mode.AverageTime)
  @OutputTimeUnit(TimeUnit.MICROSECONDS)
  public void queryFilteredSingleQueryableIndex(Blackhole blackhole) throws Exception {
    final QueryRunner<Result<TimeseriesResultValue>> runner =
        QueryBenchmarkUtil.makeQueryRunner(
            factory, "qIndex", new QueryableIndexSegment("qIndex", qIndexes.get(0)));

    DimFilter filter = new SelectorDimFilter("dimSequential", "399", null);
    Query filteredQuery = query.withDimFilter(filter);

    List<Result<TimeseriesResultValue>> results =
        TimeseriesBenchmark.runQuery(factory, runner, filteredQuery);
    for (Result<TimeseriesResultValue> result : results) {
      blackhole.consume(result);
    }
  }
Ejemplo n.º 25
0
 @Benchmark
 public void vectorLSE(final Blackhole bh) {
   bh.consume(SIMDMath.logSumExp(src));
 }
Ejemplo n.º 26
0
 @Benchmark
 public void atomicLongGetAndSet(AtomicLongState state, Times repeat, Blackhole bh) {
   for (long i = 0; i < repeat.times; i++) {
     bh.consume(state.value.getAndSet(i));
   }
 }
 @Benchmark
 public void timeEqualsDeltaDuplicate(Blackhole bh) {
   bh.consume(testMap.equals(testMapDeltaDuplicate));
 }
 @Benchmark
 public void timeEqualsRealDuplicateModified(Blackhole bh) {
   bh.consume(testMap.equals(testMapRealDuplicateSameSizeButDifferent));
 }
Ejemplo n.º 29
0
 @Benchmark
 public void volatileLongRead(VolatileLongState state, Times repeat, Blackhole bh) {
   for (int i = 0; i < repeat.times; i++) {
     bh.consume(state.value);
   }
 }
 @Benchmark
 public void timeIteration(Blackhole bh) {
   for (Iterator<IValue> iterator = testMap.iterator(); iterator.hasNext(); ) {
     bh.consume(iterator.next());
   }
 }