本文整理汇总了Java中org.openjdk.jmh.annotations.OperationsPerInvocation类的典型用法代码示例。如果您正苦于以下问题:Java OperationsPerInvocation类的具体用法?Java OperationsPerInvocation怎么用?Java OperationsPerInvocation使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OperationsPerInvocation类属于org.openjdk.jmh.annotations包,在下文中一共展示了OperationsPerInvocation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testApi
import org.openjdk.jmh.annotations.OperationsPerInvocation; //导入依赖的package包/类
@Benchmark
@BenchmarkMode(Mode.Throughput)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@Fork(1)
@OperationsPerInvocation(10000)
public void testApi() {
Map<String, Object> data = new HashMap<String, Object>();
data.put("encryptKey", "0000000000000000");
data.put("barcode", "LH10312ACCF23C4F3A5");
Multimap<String, Rule> rules = ArrayListMultimap.create();
rules.put("barcode", Rule.required());
rules.put("barcode", Rule.regex("[0-9A-F]{16}"));
rules.put("encryptKey", Rule.required());
rules.put("encryptKey", Rule.regex("LH[0-7][0-9a-fA-F]{2}[0-5][0-4][0-9a-fA-F]{12}"));
try {
Validations.validate(data, rules);
} catch (Exception e) {
}
}
示例2: testAverage
import org.openjdk.jmh.annotations.OperationsPerInvocation; //导入依赖的package包/类
@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
@Fork(1)
@OperationsPerInvocation(10000)
public void testAverage() {
Map<String, Object> data = new HashMap<String, Object>();
data.put("encryptKey", "0000000000000000");
data.put("barcode", "LH10312ACCF23C4F3A5");
Multimap<String, Rule> rules = ArrayListMultimap.create();
rules.put("barcode", Rule.required());
rules.put("barcode", Rule.regex("[0-9A-F]{16}"));
rules.put("encryptKey", Rule.required());
rules.put("encryptKey", Rule.regex("LH[0-7][0-9a-fA-F]{2}[0-5][0-4][0-9a-fA-F]{12}"));
try {
Validations.validate(data, rules);
} catch (Exception e) {
}
}
示例3: groupByHashPreCompute
import org.openjdk.jmh.annotations.OperationsPerInvocation; //导入依赖的package包/类
@Benchmark
@OperationsPerInvocation(POSITIONS)
public Object groupByHashPreCompute(BenchmarkData data)
{
GroupByHash groupByHash = new MultiChannelGroupByHash(data.getTypes(), data.getChannels(), Optional.empty(), data.getHashChannel(), EXPECTED_SIZE, false);
data.getPages().forEach(groupByHash::getGroupIds);
ImmutableList.Builder<Page> pages = ImmutableList.builder();
PageBuilder pageBuilder = new PageBuilder(groupByHash.getTypes());
for (int groupId = 0; groupId < groupByHash.getGroupCount(); groupId++) {
pageBuilder.declarePosition();
groupByHash.appendValuesTo(groupId, pageBuilder, 0);
if (pageBuilder.isFull()) {
pages.add(pageBuilder.build());
pageBuilder.reset();
}
}
pages.add(pageBuilder.build());
return pageBuilder.build();
}
示例4: addPagePreCompute
import org.openjdk.jmh.annotations.OperationsPerInvocation; //导入依赖的package包/类
@Benchmark
@OperationsPerInvocation(POSITIONS)
public Object addPagePreCompute(BenchmarkData data)
{
GroupByHash groupByHash = new MultiChannelGroupByHash(data.getTypes(), data.getChannels(), Optional.empty(), data.getHashChannel(), EXPECTED_SIZE, false);
data.getPages().forEach(groupByHash::addPage);
ImmutableList.Builder<Page> pages = ImmutableList.builder();
PageBuilder pageBuilder = new PageBuilder(groupByHash.getTypes());
for (int groupId = 0; groupId < groupByHash.getGroupCount(); groupId++) {
pageBuilder.declarePosition();
groupByHash.appendValuesTo(groupId, pageBuilder, 0);
if (pageBuilder.isFull()) {
pages.add(pageBuilder.build());
pageBuilder.reset();
}
}
pages.add(pageBuilder.build());
return pageBuilder.build();
}
示例5: bigintGroupByHash
import org.openjdk.jmh.annotations.OperationsPerInvocation; //导入依赖的package包/类
@Benchmark
@OperationsPerInvocation(POSITIONS)
public Object bigintGroupByHash(SingleChannelBenchmarkData data)
{
GroupByHash groupByHash = new BigintGroupByHash(0, Optional.empty(), data.getHashEnabled(), EXPECTED_SIZE);
data.getPages().forEach(groupByHash::addPage);
ImmutableList.Builder<Page> pages = ImmutableList.builder();
PageBuilder pageBuilder = new PageBuilder(groupByHash.getTypes());
for (int groupId = 0; groupId < groupByHash.getGroupCount(); groupId++) {
pageBuilder.declarePosition();
groupByHash.appendValuesTo(groupId, pageBuilder, 0);
if (pageBuilder.isFull()) {
pages.add(pageBuilder.build());
pageBuilder.reset();
}
}
pages.add(pageBuilder.build());
return pageBuilder.build();
}
示例6: compareOneByte
import org.openjdk.jmh.annotations.OperationsPerInvocation; //导入依赖的package包/类
@Benchmark
@OperationsPerInvocation(COMPARISONS_PER_INVOCATION)
public final void compareOneByte(final Blackhole blackhole) {
int res = 0;
for (int i = 0; i < COMPARISONS_PER_INVOCATION; ++i) {
res += FasterByteComparison.compare(ONE_BYTE, MANY_BYTES);
}
blackhole.consume(res);
}
示例7: compareTwoBytes
import org.openjdk.jmh.annotations.OperationsPerInvocation; //导入依赖的package包/类
@Benchmark
@OperationsPerInvocation(COMPARISONS_PER_INVOCATION)
public final void compareTwoBytes(final Blackhole blackhole) {
int res = 0;
for (int i = 0; i < COMPARISONS_PER_INVOCATION; ++i) {
res += FasterByteComparison.compare(TWO_BYTES, MANY_BYTES);
}
blackhole.consume(res);
}
示例8: compareThreeBytes
import org.openjdk.jmh.annotations.OperationsPerInvocation; //导入依赖的package包/类
@Benchmark
@OperationsPerInvocation(COMPARISONS_PER_INVOCATION)
public final void compareThreeBytes(final Blackhole blackhole) {
int res = 0;
for (int i = 0; i < COMPARISONS_PER_INVOCATION; ++i) {
res += FasterByteComparison.compare(THREE_BYTES, MANY_BYTES);
}
blackhole.consume(res);
}
示例9: compareFourBytes
import org.openjdk.jmh.annotations.OperationsPerInvocation; //导入依赖的package包/类
@Benchmark
@OperationsPerInvocation(COMPARISONS_PER_INVOCATION)
public final void compareFourBytes(final Blackhole blackhole) {
int res = 0;
for (int i = 0; i < COMPARISONS_PER_INVOCATION; ++i) {
res += FasterByteComparison.compare(FOUR_BYTES, MANY_BYTES);
}
blackhole.consume(res);
}
示例10: compareFiveBytes
import org.openjdk.jmh.annotations.OperationsPerInvocation; //导入依赖的package包/类
@Benchmark
@OperationsPerInvocation(COMPARISONS_PER_INVOCATION)
public final void compareFiveBytes(final Blackhole blackhole) {
int res = 0;
for (int i = 0; i < COMPARISONS_PER_INVOCATION; ++i) {
res += FasterByteComparison.compare(FIVE_BYTES, MANY_BYTES);
}
blackhole.consume(res);
}
示例11: compareSixBytes
import org.openjdk.jmh.annotations.OperationsPerInvocation; //导入依赖的package包/类
@Benchmark
@OperationsPerInvocation(COMPARISONS_PER_INVOCATION)
public final void compareSixBytes(final Blackhole blackhole) {
int res = 0;
for (int i = 0; i < COMPARISONS_PER_INVOCATION; ++i) {
res += FasterByteComparison.compare(SIX_BYTES, MANY_BYTES);
}
blackhole.consume(res);
}
示例12: compareSevenBytes
import org.openjdk.jmh.annotations.OperationsPerInvocation; //导入依赖的package包/类
@Benchmark
@OperationsPerInvocation(COMPARISONS_PER_INVOCATION)
public final void compareSevenBytes(final Blackhole blackhole) {
int res = 0;
for (int i = 0; i < COMPARISONS_PER_INVOCATION; ++i) {
res += FasterByteComparison.compare(SEVEN_BYTES, MANY_BYTES);
}
blackhole.consume(res);
}
示例13: compareEightBytes
import org.openjdk.jmh.annotations.OperationsPerInvocation; //导入依赖的package包/类
@Benchmark
@OperationsPerInvocation(COMPARISONS_PER_INVOCATION)
public final void compareEightBytes(final Blackhole blackhole) {
int res = 0;
for (int i = 0; i < COMPARISONS_PER_INVOCATION; ++i) {
res += FasterByteComparison.compare(EIGHT_BYTES, MANY_BYTES);
}
blackhole.consume(res);
}
示例14: compareNineBytes
import org.openjdk.jmh.annotations.OperationsPerInvocation; //导入依赖的package包/类
@Benchmark
@OperationsPerInvocation(COMPARISONS_PER_INVOCATION)
public final void compareNineBytes(final Blackhole blackhole) {
int res = 0;
for (int i = 0; i < COMPARISONS_PER_INVOCATION; ++i) {
res += FasterByteComparison.compare(NINE_BYTES, MANY_BYTES);
}
blackhole.consume(res);
}
示例15: compareTenBytes
import org.openjdk.jmh.annotations.OperationsPerInvocation; //导入依赖的package包/类
@Benchmark
@OperationsPerInvocation(COMPARISONS_PER_INVOCATION)
public final void compareTenBytes(final Blackhole blackhole) {
int res = 0;
for (int i = 0; i < COMPARISONS_PER_INVOCATION; ++i) {
res += FasterByteComparison.compare(TEN_BYTES, MANY_BYTES);
}
blackhole.consume(res);
}