Search in sources :

Example 1 with LongListOffHeap

use of com.swirlds.jasperdb.collections.LongListOffHeap in project hedera-services by hashgraph.

the class IndexDumpBench method setup.

@Setup(Level.Trial)
public void setup() throws Exception {
    // crate a pile of data in RAM
    final long GB = 1024 * 1024 * 1024;
    final long sizeBytes = dataSizeGb * GB;
    final long sizeLongs = sizeBytes / Long.BYTES;
    System.out.println("sizeBytes = " + sizeBytes);
    System.out.println("sizeLongs = " + sizeLongs);
    Random random = new Random(1234);
    data = memoryType.equals("heap") ? new LongListHeap() : new LongListOffHeap();
    for (long i = 0; i < sizeLongs; i++) {
        data.put(i, random.nextLong());
    }
}
Also used : LongListHeap(com.swirlds.jasperdb.collections.LongListHeap) Random(java.util.Random) LongListOffHeap(com.swirlds.jasperdb.collections.LongListOffHeap)

Example 2 with LongListOffHeap

use of com.swirlds.jasperdb.collections.LongListOffHeap in project hedera-services by hashgraph.

the class IndexDumpConcurrentBench method setup.

@Setup(Level.Trial)
public void setup() throws Exception {
    // crate a pile of data in RAM
    final long sizeLongs = 1_000_000_000;
    final long sizeLongs3 = 1_000_000;
    Random random = new Random(1234);
    data1 = memoryType.equals("heap") ? new LongListHeap() : new LongListOffHeap();
    data2 = memoryType.equals("heap") ? new LongListHeap() : new LongListOffHeap();
    data3 = memoryType.equals("heap") ? new LongListHeap() : new LongListOffHeap();
    for (long i = 0; i < sizeLongs; i++) {
        data1.put(i, random.nextLong());
        data2.put(i, random.nextLong());
        if (i < sizeLongs3)
            data3.put(i, random.nextLong());
    }
}
Also used : LongListHeap(com.swirlds.jasperdb.collections.LongListHeap) Random(java.util.Random) LongListOffHeap(com.swirlds.jasperdb.collections.LongListOffHeap)

Aggregations

LongListHeap (com.swirlds.jasperdb.collections.LongListHeap)2 LongListOffHeap (com.swirlds.jasperdb.collections.LongListOffHeap)2 Random (java.util.Random)2