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


Java Benchmark类代码示例

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


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

示例1: coldCreateAndClose

import dk.ilios.spanner.Benchmark; //导入依赖的package包/类
@Benchmark
public void coldCreateAndClose(long reps) {
    for (long i = 0; i < reps; i++) {
        Realm realm = Realm.getInstance(coldConfig);
        realm.close();
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:8,代码来源:RealmBenchmarks.java

示例2: emptyTransaction

import dk.ilios.spanner.Benchmark; //导入依赖的package包/类
@Benchmark
public void emptyTransaction(long reps) {
    for (long i = 0; i < reps; i++) {
        realm.beginTransaction();
        realm.commitTransaction();
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:8,代码来源:RealmBenchmarks.java

示例3: createObjects

import dk.ilios.spanner.Benchmark; //导入依赖的package包/类
@Benchmark
public void createObjects(long reps) {
    RealmResults<AllTypes> results = realm.where(AllTypes.class).findAll();
    for (long i = 0; i < reps; i++) {
        results.first();
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:8,代码来源:RealmAllocBenchmarks.java

示例4: createRealmResults

import dk.ilios.spanner.Benchmark; //导入依赖的package包/类
@Benchmark
public void createRealmResults(long reps) {
    RealmQuery<AllTypes> query = realm.where(AllTypes.class);
    for (long i = 0; i < reps; i++) {
        query.findAll();
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:8,代码来源:RealmAllocBenchmarks.java

示例5: createRealmLists

import dk.ilios.spanner.Benchmark; //导入依赖的package包/类
@Benchmark
public void createRealmLists(long reps) {
    AllTypes allTypes = realm.where(AllTypes.class).findFirst();
    for (long i = 0; i < reps; i++) {
        //noinspection ConstantConditions
        allTypes.getColumnRealmList();
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:RealmAllocBenchmarks.java

示例6: insertNoPrimaryKey

import dk.ilios.spanner.Benchmark; //导入依赖的package包/类
@Benchmark
public void insertNoPrimaryKey(long reps) {
    AllTypes allTypes = new AllTypes();
    for (long i = 0; i < reps; i++) {
        realm.insert(allTypes);
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:8,代码来源:RealmInsertBenchmark.java

示例7: insertWithPrimaryKey

import dk.ilios.spanner.Benchmark; //导入依赖的package包/类
@Benchmark
public void insertWithPrimaryKey(long reps) {
    AllTypesPrimaryKey allTypesPrimaryKey = new AllTypesPrimaryKey();
    for (long i = 0; i < reps; i++) {
        allTypesPrimaryKey.setColumnLong(i);
        realm.insertOrUpdate(allTypesPrimaryKey);
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:RealmInsertBenchmark.java

示例8: combineHashCodes

import dk.ilios.spanner.Benchmark; //导入依赖的package包/类
@Benchmark
public int combineHashCodes() {
    int dummy = 0;

    int combined = 0;
    for (Object item : items) {
        combined ^= item.hashCode();
    }

    dummy += combined;

    return dummy;
}
 
开发者ID:karlicoss,项目名称:autohash,代码行数:14,代码来源:CachedVsNotCachedBenchmark.java

示例9: getFromSmallHashSet

import dk.ilios.spanner.Benchmark; //导入依赖的package包/类
@Benchmark
public boolean getFromSmallHashSet() {
    HashSet<Object> set = new HashSet<>();
    // add few items to prevent check for empty map
    set.add(new Object());
    set.add(4);
    set.add("tralalal");

    boolean dummy = true;
    for (Object item: items) {
        dummy &= set.contains(item);
    }

    return dummy;
}
 
开发者ID:karlicoss,项目名称:autohash,代码行数:16,代码来源:CachedVsNotCachedBenchmark.java

示例10: putInHashSet

import dk.ilios.spanner.Benchmark; //导入依赖的package包/类
@Benchmark
public int putInHashSet() {
    HashSet<Object> set = new HashSet<>(items);

    int dummy = set.size();

    return dummy;
}
 
开发者ID:karlicoss,项目名称:autohash,代码行数:9,代码来源:CachedVsNotCachedBenchmark.java

示例11: putInHashSetAndGetOnce

import dk.ilios.spanner.Benchmark; //导入依赖的package包/类
@Benchmark
public boolean putInHashSetAndGetOnce() {
    HashSet<Object> set = new HashSet<>(items);

    boolean dummy = true;
    for (Object item: items) {
        dummy &= set.contains(item);
    }

    return dummy;
}
 
开发者ID:karlicoss,项目名称:autohash,代码行数:12,代码来源:CachedVsNotCachedBenchmark.java

示例12: putInHashSetAndGetTenTimes

import dk.ilios.spanner.Benchmark; //导入依赖的package包/类
@Benchmark
public boolean putInHashSetAndGetTenTimes() {
    HashSet<Object> set = new HashSet<>(items);

    boolean dummy = true;
    for (int q = 0; q < 10; q++) {
        for (Object item : items) {
            dummy &= set.contains(item);
        }
    }

    return dummy;
}
 
开发者ID:karlicoss,项目名称:autohash,代码行数:14,代码来源:CachedVsNotCachedBenchmark.java

示例13: write500ContactsBinary

import dk.ilios.spanner.Benchmark; //导入依赖的package包/类
@Benchmark
public void write500ContactsBinary() throws IOException {
    //Buffer buffer = new Buffer();
    buffer.writeInt(contacts.size());
    for (Person contact : contacts) {
        contact.writeObject(buffer);
    }
}
 
开发者ID:FabianTerhorst,项目名称:Floppy,代码行数:9,代码来源:FloppyBenchmark.java

示例14: writeShortString

import dk.ilios.spanner.Benchmark; //导入依赖的package包/类
@Benchmark
public void writeShortString(long reps) {
    for (long i = 0; i < reps; i++) {
        writeObject.setColumnString("Foo");
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:7,代码来源:RealmObjectWriteBenchmarks.java

示例15: writeMediumString

import dk.ilios.spanner.Benchmark; //导入依赖的package包/类
@Benchmark
public void writeMediumString(long reps) {
    for (long i = 0; i < reps; i++) {
        writeObject.setColumnString("ABCDEFHIJKLMNOPQ");
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:7,代码来源:RealmObjectWriteBenchmarks.java


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