当前位置: 首页>>代码示例>>Java>>正文


Java Warmup类代码示例

本文整理汇总了Java中org.openjdk.jmh.annotations.Warmup的典型用法代码示例。如果您正苦于以下问题:Java Warmup类的具体用法?Java Warmup怎么用?Java Warmup使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Warmup类属于org.openjdk.jmh.annotations包,在下文中一共展示了Warmup类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: generateImport

import org.openjdk.jmh.annotations.Warmup; //导入依赖的package包/类
private void generateImport(PrintWriter writer) {
    Class<?>[] imports = new Class<?>[]{
            List.class, AtomicInteger.class,
            Collection.class, ArrayList.class,
            TimeUnit.class, Generated.class, CompilerControl.class,
            InfraControl.class, ThreadParams.class,
            Result.class, ThroughputResult.class, AverageTimeResult.class,
            SampleTimeResult.class, SingleShotResult.class, SampleBuffer.class,
            Mode.class, Fork.class, Measurement.class, Threads.class, Warmup.class,
            BenchmarkMode.class, RawResults.class, ResultRole.class,
            Field.class, BenchmarkParams.class, IterationParams.class
    };

    for (Class<?> c : imports) {
        writer.println("import " + c.getName() + ';');
    }
    writer.println();
}
 
开发者ID:msteindorfer,项目名称:jmh,代码行数:19,代码来源:BenchmarkGenerator.java

示例2: measureWrong_1

import org.openjdk.jmh.annotations.Warmup; //导入依赖的package包/类
@Benchmark
@Warmup(iterations = 5, time = 1)
@Measurement(iterations = 5, time = 1)
@BenchmarkMode(Mode.AverageTime)
public List<String> measureWrong_1() {
    list.add(list.size() / 2, "something");
    return list;
}
 
开发者ID:mumudemo,项目名称:mumu-benchmark,代码行数:9,代码来源:JMHSample_26_BatchSize.java

示例3: measureWrong_5

import org.openjdk.jmh.annotations.Warmup; //导入依赖的package包/类
@Benchmark
@Warmup(iterations = 5, time = 5)
@Measurement(iterations = 5, time = 5)
@BenchmarkMode(Mode.AverageTime)
public List<String> measureWrong_5() {
    list.add(list.size() / 2, "something");
    return list;
}
 
开发者ID:mumudemo,项目名称:mumu-benchmark,代码行数:9,代码来源:JMHSample_26_BatchSize.java

示例4: measureRight

import org.openjdk.jmh.annotations.Warmup; //导入依赖的package包/类
@Benchmark
@Warmup(iterations = 5, batchSize = 5000)
@Measurement(iterations = 5, batchSize = 5000)
@BenchmarkMode(Mode.SingleShotTime)
public List<String> measureRight() {
    list.add(list.size() / 2, "something");
    return list;
}
 
开发者ID:mumudemo,项目名称:mumu-benchmark,代码行数:9,代码来源:JMHSample_26_BatchSize.java

示例5: testCascadedValidation

import org.openjdk.jmh.annotations.Warmup; //导入依赖的package包/类
@Benchmark
@BenchmarkMode(Mode.Throughput)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@Fork(value = 1)
@Threads(1)
@Warmup(iterations = 5)
@Measurement(iterations = 20)
public void testCascadedValidation(ParsingBeansSpeedState state, Blackhole bh) {
	// Validator in new factory

	for ( Object o : state.holder.beans ) {
		bh.consume( state.validator.getConstraintsForClass( o.getClass() ).isBeanConstrained() );
	}
}
 
开发者ID:hibernate,项目名称:beanvalidation-benchmark,代码行数:15,代码来源:ParsingBeansSpeedBenchmark.java

示例6: testCascadedValidation

import org.openjdk.jmh.annotations.Warmup; //导入依赖的package包/类
@Benchmark
@BenchmarkMode(Mode.Throughput)
@OutputTimeUnit(TimeUnit.SECONDS)
@Fork(value = 1)
@Threads(50)
@Warmup(iterations = 20) // it seems that as there are a lot of beans it takes some time to warmup
@Measurement(iterations = 30)
public void testCascadedValidation(RawValidationSpeedState state, Blackhole bh) {
	for ( Object o : state.holder.beans ) {
		Set<ConstraintViolation<Object>> constraintViolations = state.validator.validate( o );
		bh.consume( constraintViolations );
	}
}
 
开发者ID:hibernate,项目名称:beanvalidation-benchmark,代码行数:14,代码来源:RawValidationSpeedBenchmark.java

示例7: getAndIncAge

import org.openjdk.jmh.annotations.Warmup; //导入依赖的package包/类
@Benchmark
@Warmup(iterations = 20)
public int getAndIncAge(ThreadState state) {
    Person person = state.person;
    int oldAge = person.getAge();
    person.setAge(oldAge + 1);
    return oldAge;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:9,代码来源:SimpleSyncBenchmark.java

示例8: addBoxedAndClear

import org.openjdk.jmh.annotations.Warmup; //导入依赖的package包/类
@Benchmark
@Warmup(iterations = 20)
public void addBoxedAndClear(ThreadState state) {
    for (int i = 0; i < N; ++i) {
        state.list.add(i);
    }
    state.list.clear();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:9,代码来源:ArrayListBenchmark.java

示例9: addNullAndClear

import org.openjdk.jmh.annotations.Warmup; //导入依赖的package包/类
@Benchmark
@Warmup(iterations = 20)
public void addNullAndClear(ThreadState state) {
    for (int i = 0; i < N; ++i) {
        state.list.add(null);
    }
    state.list.clear();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:9,代码来源:ArrayListBenchmark.java

示例10: addNull

import org.openjdk.jmh.annotations.Warmup; //导入依赖的package包/类
@Benchmark
@Warmup(iterations = 20)
public void addNull(ClearedThreadState state) {
    for (int i = 0; i < N; ++i) {
        state.list.add(null);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:8,代码来源:ArrayListBenchmark.java

示例11: addBoxed

import org.openjdk.jmh.annotations.Warmup; //导入依赖的package包/类
@Benchmark
@Warmup(iterations = 20)
public void addBoxed(ThreadState state) {
    for (int i = 0; i < N; ++i) {
        state.list.put(i, i);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:8,代码来源:ConcurrentSkipListBenchmark.java

示例12: hash

import org.openjdk.jmh.annotations.Warmup; //导入依赖的package包/类
@Benchmark
@Warmup(iterations = 20)
public int hash(ThreadState state) {
    int value = 0;
    char[] array = state.characters;
    for (int i = 0; i < array.length; ++i) {
        value = value * 31 + array[i];
    }
    return value;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:HashBenchmark.java

示例13: mathLog

import org.openjdk.jmh.annotations.Warmup; //导入依赖的package包/类
@Benchmark
@Warmup(iterations = 5)
public void mathLog(ThreadState state) {
    double[] data = state.data;
    for (int i = 0; i < data.length; i++) {
        double[] result = state.result;
        result[i] = Math.log(data[i]);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:MathFunctionBenchmark.java

示例14: mathLog10

import org.openjdk.jmh.annotations.Warmup; //导入依赖的package包/类
@Benchmark
@Warmup(iterations = 5)
public void mathLog10(ThreadState state) {
    double[] data = state.data;
    for (int i = 0; i < data.length; i++) {
        double[] result = state.result;
        result[i] = Math.log10(data[i]);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:MathFunctionBenchmark.java

示例15: mathSin

import org.openjdk.jmh.annotations.Warmup; //导入依赖的package包/类
@Benchmark
@Warmup(iterations = 5)
public void mathSin(ThreadState state) {
    double[] data = state.data;
    for (int i = 0; i < data.length; i++) {
        double[] result = state.result;
        result[i] = Math.sin(data[i]);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:MathFunctionBenchmark.java


注:本文中的org.openjdk.jmh.annotations.Warmup类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。