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


Java BenchmarkParams类代码示例

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


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

示例1: benchSetup

import org.openjdk.jmh.infra.BenchmarkParams; //导入依赖的package包/类
@Setup(Level.Trial)
public void benchSetup(BenchmarkParams params) throws TException {
    testObject = new ThriftTestObject();
    testObject.addToField1(createElement("1"));
    testObject.addToField1(createElement("2"));
    testObject.addToField1(createElement("3"));
    testObject.addToField1(createElement("4"));

    testObject.addToField1(createElement("1"));
    testObject.addToField1(createElement("2"));
    testObject.addToField1(createElement("3"));
    testObject.addToField1(createElement("4"));

    testObject.addToField1(createElement("1"));
    testObject.addToField1(createElement("2"));
    testObject.addToField1(createElement("3"));
    testObject.addToField1(createElement("4"));

    testObject.addToField1(createElement("1"));
    testObject.addToField1(createElement("2"));
    testObject.addToField1(createElement("3"));
    testObject.addToField1(createElement("4"));
    serializer = new TSerializer(new TCompactProtocol.Factory());
    deserializer = new TDeserializer(new TCompactProtocol.Factory());
    testData = serializer.serialize(testObject);
}
 
开发者ID:json-iterator,项目名称:java-benchmark,代码行数:27,代码来源:DeserThrift.java

示例2: benchSetup

import org.openjdk.jmh.infra.BenchmarkParams; //导入依赖的package包/类
@Setup(Level.Trial)
public void benchSetup(BenchmarkParams params) {
    testObject = Pb.PbTestObject.newBuilder()
            .addField1(Pb.PbTestObject.ElementObject.newBuilder().setField1("1").build())
            .addField1(Pb.PbTestObject.ElementObject.newBuilder().setField1("2").build())
            .addField1(Pb.PbTestObject.ElementObject.newBuilder().setField1("3").build())
            .addField1(Pb.PbTestObject.ElementObject.newBuilder().setField1("4").build())

            .addField1(Pb.PbTestObject.ElementObject.newBuilder().setField1("1").build())
            .addField1(Pb.PbTestObject.ElementObject.newBuilder().setField1("2").build())
            .addField1(Pb.PbTestObject.ElementObject.newBuilder().setField1("3").build())
            .addField1(Pb.PbTestObject.ElementObject.newBuilder().setField1("4").build())

            .addField1(Pb.PbTestObject.ElementObject.newBuilder().setField1("1").build())
            .addField1(Pb.PbTestObject.ElementObject.newBuilder().setField1("2").build())
            .addField1(Pb.PbTestObject.ElementObject.newBuilder().setField1("3").build())
            .addField1(Pb.PbTestObject.ElementObject.newBuilder().setField1("4").build())

            .addField1(Pb.PbTestObject.ElementObject.newBuilder().setField1("1").build())
            .addField1(Pb.PbTestObject.ElementObject.newBuilder().setField1("2").build())
            .addField1(Pb.PbTestObject.ElementObject.newBuilder().setField1("3").build())
            .addField1(Pb.PbTestObject.ElementObject.newBuilder().setField1("4").build())
            .build();
    byteArrayOutputStream = new ByteArrayOutputStream();
}
 
开发者ID:json-iterator,项目名称:java-benchmark,代码行数:26,代码来源:SerPb.java

示例3: benchSetup

import org.openjdk.jmh.infra.BenchmarkParams; //导入依赖的package包/类
@Setup(Level.Trial)
public void benchSetup(BenchmarkParams params) {
    Pb.PbTestObject obj = Pb.PbTestObject.newBuilder()
            .addField1(Pb.PbTestObject.ElementObject.newBuilder().setField1("1").build())
            .addField1(Pb.PbTestObject.ElementObject.newBuilder().setField1("2").build())
            .addField1(Pb.PbTestObject.ElementObject.newBuilder().setField1("3").build())
            .addField1(Pb.PbTestObject.ElementObject.newBuilder().setField1("4").build())

            .addField1(Pb.PbTestObject.ElementObject.newBuilder().setField1("1").build())
            .addField1(Pb.PbTestObject.ElementObject.newBuilder().setField1("2").build())
            .addField1(Pb.PbTestObject.ElementObject.newBuilder().setField1("3").build())
            .addField1(Pb.PbTestObject.ElementObject.newBuilder().setField1("4").build())

            .addField1(Pb.PbTestObject.ElementObject.newBuilder().setField1("1").build())
            .addField1(Pb.PbTestObject.ElementObject.newBuilder().setField1("2").build())
            .addField1(Pb.PbTestObject.ElementObject.newBuilder().setField1("3").build())
            .addField1(Pb.PbTestObject.ElementObject.newBuilder().setField1("4").build())

            .addField1(Pb.PbTestObject.ElementObject.newBuilder().setField1("1").build())
            .addField1(Pb.PbTestObject.ElementObject.newBuilder().setField1("2").build())
            .addField1(Pb.PbTestObject.ElementObject.newBuilder().setField1("3").build())
            .addField1(Pb.PbTestObject.ElementObject.newBuilder().setField1("4").build())
            .build();
    testData = obj.toByteArray();
}
 
开发者ID:json-iterator,项目名称:java-benchmark,代码行数:26,代码来源:DeserPb.java

示例4: benchSetup

import org.openjdk.jmh.infra.BenchmarkParams; //导入依赖的package包/类
@Setup(Level.Trial)
public void benchSetup(BenchmarkParams params) {
    testObject = Pb.PbTestObject.newBuilder()
            .addField1(321)
            .addField1(123)
            .addField1(132)
            .addField1(312)

            .addField1(321)
            .addField1(123)
            .addField1(132)
            .addField1(312)

            .addField1(321)
            .addField1(123)
            .addField1(132)
            .addField1(312)

            .addField1(321)
            .addField1(123)
            .addField1(132)
            .addField1(312)
            .build();
    byteArrayOutputStream = new ByteArrayOutputStream();
}
 
开发者ID:json-iterator,项目名称:java-benchmark,代码行数:26,代码来源:SerPb.java

示例5: benchSetup

import org.openjdk.jmh.infra.BenchmarkParams; //导入依赖的package包/类
@Setup(Level.Trial)
public void benchSetup(BenchmarkParams params) throws TException {
    testObject = new ThriftTestObject();
    testObject.addToField1(321);
    testObject.addToField1(123);
    testObject.addToField1(132);
    testObject.addToField1(312);
    testObject.addToField1(321);
    testObject.addToField1(123);
    testObject.addToField1(132);
    testObject.addToField1(312);
    testObject.addToField1(321);
    testObject.addToField1(123);
    testObject.addToField1(132);
    testObject.addToField1(312);
    testObject.addToField1(321);
    testObject.addToField1(123);
    testObject.addToField1(132);
    testObject.addToField1(312);
    byteArrayOutputStream = new ByteArrayOutputStream();
    TCompactProtocol.Factory protocolFactory = new TCompactProtocol.Factory();
    protocol = protocolFactory.getProtocol(new TIOStreamTransport(byteArrayOutputStream));
}
 
开发者ID:json-iterator,项目名称:java-benchmark,代码行数:24,代码来源:SerThrift.java

示例6: benchSetup

import org.openjdk.jmh.infra.BenchmarkParams; //导入依赖的package包/类
@Setup(Level.Trial)
public void benchSetup(BenchmarkParams params) throws TException {
    ThriftTestWriteObject testObject = new ThriftTestWriteObject();
    testObject.setField1(Arrays.asList("1", "2", "3", "4", "5",
            "1", "2", "3", "4", "5",
            "1", "2", "3", "4", "5"));
    HashMap<String, List<String>> field2 = new HashMap<>();
    field2.put("1", Arrays.asList("1", "2", "3", "4", "5"));
    field2.put("2", Arrays.asList("1", "2", "3", "4", "5"));
    field2.put("3", Arrays.asList("1", "2", "3", "4", "5"));
    testObject.setField2(field2);
    testObject.setField3("x-3");
    serializer = new TSerializer(new TCompactProtocol.Factory());
    deserializer = new TDeserializer(new TCompactProtocol.Factory());
    testData = serializer.serialize(testObject);
}
 
开发者ID:json-iterator,项目名称:java-benchmark,代码行数:17,代码来源:DeserThrift.java

示例7: benchSetup

import org.openjdk.jmh.infra.BenchmarkParams; //导入依赖的package包/类
@Setup(Level.Trial)
public void benchSetup(BenchmarkParams params) {
    testObject = Pb.PbTestObject.newBuilder()
            .addField1(31.415926)
            .addField1(61.415923)
            .addField1(31.415269)
            .addField1(53.141926)
            .addField1(13.145926)
            .addField1(43.115926)
            .addField1(31.419265)
            .addField1(23.141596)
            .addField1(43.161592)
            .addField1(0.112)
            .build();
    byteArrayOutputStream = new ByteArrayOutputStream();
}
 
开发者ID:json-iterator,项目名称:java-benchmark,代码行数:17,代码来源:SerPb.java

示例8: benchSetup

import org.openjdk.jmh.infra.BenchmarkParams; //导入依赖的package包/类
@Setup(Level.Trial)
public void benchSetup(BenchmarkParams params) {
    Pb.PbTestObject obj = Pb.PbTestObject.newBuilder()
            .addField1(31.415926)
            .addField1(61.415923)
            .addField1(31.415269)
            .addField1(53.141926)
            .addField1(13.145926)
            .addField1(43.115926)
            .addField1(31.419265)
            .addField1(23.141596)
            .addField1(43.161592)
            .addField1(0.112)
            .build();
    testData = obj.toByteArray();
}
 
开发者ID:json-iterator,项目名称:java-benchmark,代码行数:17,代码来源:DeserPb.java

示例9: benchSetup

import org.openjdk.jmh.infra.BenchmarkParams; //导入依赖的package包/类
@Setup(Level.Trial)
public void benchSetup(BenchmarkParams params) throws TException {
    testObject = new ThriftTestObject();
    testObject.addToField1(31.415926);
    testObject.addToField1(61.415923);
    testObject.addToField1(31.415269);
    testObject.addToField1(53.141926);
    testObject.addToField1(13.145926);
    testObject.addToField1(43.115926);
    testObject.addToField1(31.419265);
    testObject.addToField1(23.141596);
    testObject.addToField1(43.161592);
    testObject.addToField1(0.112);
    serializer = new TSerializer(new TCompactProtocol.Factory());
    deserializer = new TDeserializer(new TCompactProtocol.Factory());
    testData = serializer.serialize(testObject);
}
 
开发者ID:json-iterator,项目名称:java-benchmark,代码行数:18,代码来源:DeserThrift.java

示例10: benchSetup

import org.openjdk.jmh.infra.BenchmarkParams; //导入依赖的package包/类
@Setup(Level.Trial)
public void benchSetup(BenchmarkParams params) throws TException {
    testObject = new ThriftTestObject();
    testObject.setField1("1");
    testObject.setField2("2");
    testObject.setField3("3");
    testObject.setField4("4");
    testObject.setField5("5");
    testObject.setField6("6");
    testObject.setField7("7");
    testObject.setField8("8");
    testObject.setField9("9");
    testObject.setField10("10");
    byteArrayOutputStream = new ByteArrayOutputStream();
    TCompactProtocol.Factory protocolFactory = new TCompactProtocol.Factory();
    protocol = protocolFactory.getProtocol(new TIOStreamTransport(byteArrayOutputStream));
}
 
开发者ID:json-iterator,项目名称:java-benchmark,代码行数:18,代码来源:SerThrift.java

示例11: benchSetup

import org.openjdk.jmh.infra.BenchmarkParams; //导入依赖的package包/类
@Setup(Level.Trial)
public void benchSetup(BenchmarkParams params) throws TException {
    testObject = new ThriftTestObject();
    testObject.setField1(31415926);
    testObject.setField2(61415923);
    testObject.setField3(31415269);
    testObject.setField4(53141926);
    testObject.setField5(13145926);
    testObject.setField6(43115926);
    testObject.setField7(31419265);
    testObject.setField8(23141596);
    testObject.setField9(43161592);
    testObject.setField10(112);
    serializer = new TSerializer(new TCompactProtocol.Factory());
    deserializer = new TDeserializer(new TCompactProtocol.Factory());
    testData = serializer.serialize(testObject);
}
 
开发者ID:json-iterator,项目名称:java-benchmark,代码行数:18,代码来源:DeserThrift.java

示例12: benchSetup

import org.openjdk.jmh.infra.BenchmarkParams; //导入依赖的package包/类
@Setup(Level.Trial)
public void benchSetup(BenchmarkParams params) throws TException {
    testObject = new ThriftTestObject();
    testObject.setField1(31415926);
    testObject.setField2(61415923);
    testObject.setField3(31415269);
    testObject.setField4(53141926);
    testObject.setField5(13145926);
    testObject.setField6(43115926);
    testObject.setField7(31419265);
    testObject.setField8(23141596);
    testObject.setField9(43161592);
    testObject.setField10(112);
    byteArrayOutputStream = new ByteArrayOutputStream();
    TCompactProtocol.Factory protocolFactory = new TCompactProtocol.Factory();
    protocol = protocolFactory.getProtocol(new TIOStreamTransport(byteArrayOutputStream));
}
 
开发者ID:json-iterator,项目名称:java-benchmark,代码行数:18,代码来源:SerThrift.java

示例13: setup

import org.openjdk.jmh.infra.BenchmarkParams; //导入依赖的package包/类
@Setup
public void setup(BenchmarkParams params) {
    int numDatas = Integer.valueOf(params.getParam("numDataEntries"));

    datas = new ArrayList<>(numDatas);
    IntStream.range(0, numDatas).forEach(
            i -> {
                datas.add("rando"+rand.get().nextInt());
            }
    );
}
 
开发者ID:awslabs,项目名称:swage,代码行数:12,代码来源:TypedMapBenchmarks.java

示例14: benchSetup

import org.openjdk.jmh.infra.BenchmarkParams; //导入依赖的package包/类
@Setup(Level.Trial)
public void benchSetup(BenchmarkParams params) {
    JsonStream.setMode(EncodingMode.DYNAMIC_MODE);
    JsonIterator.setMode(DecodingMode.DYNAMIC_MODE_AND_MATCH_FIELD_WITH_HASH);
    testObject = TestObject.createTestObject();
    stream = new JsonStream(null, 512);
    byteArrayOutputStream = new ByteArrayOutputStream();
}
 
开发者ID:json-iterator,项目名称:java-benchmark,代码行数:9,代码来源:SerJsoniter.java

示例15: benchSetup

import org.openjdk.jmh.infra.BenchmarkParams; //导入依赖的package包/类
@Setup(Level.Trial)
public void benchSetup(BenchmarkParams params) {
    JsonStream.setMode(EncodingMode.DYNAMIC_MODE);
    JsonIterator.setMode(DecodingMode.DYNAMIC_MODE_AND_MATCH_FIELD_WITH_HASH);
    testJSON = TestObject.createTestJSON();
    iter = new JsonIterator();
    typeLiteral = TypeLiteral.create(TestObject.class);
}
 
开发者ID:json-iterator,项目名称:java-benchmark,代码行数:9,代码来源:DeserJsoniter.java


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