本文整理汇总了Java中org.openjdk.jmh.annotations.Level.Invocation方法的典型用法代码示例。如果您正苦于以下问题:Java Level.Invocation方法的具体用法?Java Level.Invocation怎么用?Java Level.Invocation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openjdk.jmh.annotations.Level
的用法示例。
在下文中一共展示了Level.Invocation方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setup
import org.openjdk.jmh.annotations.Level; //导入方法依赖的package包/类
@Setup(Level.Invocation)
public void setup() {
switch (msType) {
case "InvertedIndexTagStore":
int initialMapSize = 10000;
ms = new InvertedIndexTagStore(initialMapSize, initialMapSize);
metrics = new ArrayList();
for (int i = 0; i < initialMapSize; i++) {
metrics.add(randomMetric(numMetrics, numKeys, numValues));
}
break;
default:
throw new RuntimeException("invalid msType: " + msType);
}
}
示例2: afterInvocation
import org.openjdk.jmh.annotations.Level; //导入方法依赖的package包/类
@TearDown(Level.Invocation)
public void afterInvocation() {
if (invocation == 0) {
// Only need to check the first invocation
invocation++;
for (int i = 0; i < nodes.length; i++) {
if (nodes[i] != originalNodes[i]) {
throw new InternalError(String.format("Benchmark method mutated node %d: original=%s, current=%s", i, originalNodes[i], nodes[i]));
}
}
}
}
示例3: createTasks
import org.openjdk.jmh.annotations.Level; //导入方法依赖的package包/类
/**
* Runs before each invocation of the benchmark in order to store the tasks
* that we will transition in the benchmark.
*/
@Setup(Level.Invocation)
public void createTasks() {
tasks = new Tasks.Builder()
.setScheduleStatus(ScheduleStatus.STARTING)
.build(NUM_TASKS);
storage.write(
(NoResult.Quiet) storeProvider -> storeProvider.getUnsafeTaskStore().saveTasks(tasks));
countDownLatch = new CountDownLatch(tasks.size());
}
示例4: setup
import org.openjdk.jmh.annotations.Level; //导入方法依赖的package包/类
@Setup(Level.Invocation)
public void setup() {
items = new ArrayList<>(inputs.size());
for (Input input : inputs) {
final Object item;
if (cachingOn) {
item = Cached.create(input.accountId, input.messageIds, input.users);
} else {
item = NotCached.create(input.accountId, input.messageIds, input.users);
}
items.add(item);
}
}
示例5: setup
import org.openjdk.jmh.annotations.Level; //导入方法依赖的package包/类
@Setup(Level.Invocation)
public void setup() throws IOException {
this.heap = new int[count];
this.offheap = MemoryUtil.allocate(count * 4);
this.heap2 = new int[count];
this.offheap2 = MemoryUtil.allocate(count * 4);
}
示例6: setup
import org.openjdk.jmh.annotations.Level; //导入方法依赖的package包/类
@Setup(Level.Invocation)
public void setup() {
message = newMessage();
deferred = new DeferredObject<>();
}
示例7: setup
import org.openjdk.jmh.annotations.Level; //导入方法依赖的package包/类
@Setup(Level.Invocation)
public void setup() {
chunkStore = new ChunkImpl(
new MetricsAndTagStoreImpl(new InvertedIndexTagStore(1_000_000, 1_000_000), new VarBitMetricStore()), null);
}
示例8: setup
import org.openjdk.jmh.annotations.Level; //导入方法依赖的package包/类
@Setup(Level.Invocation)
public void setup() {
chunkManager = new ChunkManager("test", 1_000_000);
}
示例9: beforeInvocation
import org.openjdk.jmh.annotations.Level; //导入方法依赖的package包/类
@Setup(Level.Invocation)
public void beforeInvocation() {
swap();
}
示例10: beforeInvocation
import org.openjdk.jmh.annotations.Level; //导入方法依赖的package包/类
@Setup(Level.Invocation)
public void beforeInvocation() {
list.clear();
}
示例11: setup
import org.openjdk.jmh.annotations.Level; //导入方法依赖的package包/类
@Setup(Level.Invocation)
public void setup() {
prepareRequest();
}
示例12: setupGraph
import org.openjdk.jmh.annotations.Level; //导入方法依赖的package包/类
/**
* Cannot do this {@link Level#Trial only once} since {@link #emitCode()} closes the
* {@link CompilationResult}.
*/
@Setup(Level.Invocation)
public void setupGraph() {
prepareRequest();
emitFrontEnd();
}
示例13: beforeInvocation
import org.openjdk.jmh.annotations.Level; //导入方法依赖的package包/类
@Setup(Level.Invocation)
public void beforeInvocation() {
graph = (StructuredGraph) originalGraph.copy(originalGraph.getDebug());
}
示例14: beforeInvocation
import org.openjdk.jmh.annotations.Level; //导入方法依赖的package包/类
@Setup(Level.Invocation)
public void beforeInvocation() {
graph = (StructuredGraph) originalGraph.copy();
}
示例15: prepare
import org.openjdk.jmh.annotations.Level; //导入方法依赖的package包/类
@Setup(Level.Invocation)
public void prepare() {
graph = TinkerGraph.open();
g = graph.traversal();
}