Java Code Examples for org.openjdk.jmh.annotations.Mode#SingleShotTime

The following examples show how to use org.openjdk.jmh.annotations.Mode#SingleShotTime . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MeasurePadding.java    From headlong with Apache License 2.0 5 votes vote down vote up
@Benchmark
@Fork(value = 1, warmups = 1)
@BenchmarkMode(Mode.SingleShotTime)
@Warmup(iterations = 1)
@Measurement(iterations = 2)
public void cached() {
    insertPadding(paddingLen, negativeOnes, bb);
}
 
Example 2
Source File: MeasurePadding.java    From headlong with Apache License 2.0 5 votes vote down vote up
@Benchmark
@Fork(value = 1, warmups = 1)
@BenchmarkMode(Mode.SingleShotTime)
@Warmup(iterations = 1)
@Measurement(iterations = 2)
public void uncached() {
    putN(negativeOnes ? (byte) -1 : (byte) 0, paddingLen, bb);
}
 
Example 3
Source File: ReadBenchmarks.java    From parquet-mr with Apache License 2.0 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.SingleShotTime)
public void read1MRowsBS256MPS4MUncompressed(Blackhole blackhole)
        throws IOException
{
  read(file_1M_BS256M_PS4M, ONE_MILLION, blackhole);
}
 
Example 4
Source File: ReadBenchmarks.java    From parquet-mr with Apache License 2.0 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.SingleShotTime)
public void read1MRowsBS512MPS4MUncompressed(Blackhole blackhole)
        throws IOException
{
  read(file_1M_BS512M_PS4M, ONE_MILLION, blackhole);
}
 
Example 5
Source File: ReadBenchmarks.java    From parquet-mr with Apache License 2.0 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.SingleShotTime)
public void read1MRowsDefaultBlockAndPageSizeSNAPPY(Blackhole blackhole)
        throws IOException
{
  read(file_1M_SNAPPY, ONE_MILLION, blackhole);
}
 
Example 6
Source File: BenchmarkTest.java    From requery with Apache License 2.0 5 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.SingleShotTime)
public void queryJdbc() throws SQLException {
    try (Connection connection = dataSource.getConnection();
         PreparedStatement statement = connection.prepareStatement(
                 "SELECT id , name , email , birthday," +
                         " age, homepage, uuid FROM Person LIMIT 10000 ")) {

        try (ResultSet resultSet = statement.executeQuery()) {
            while (resultSet.next()) {
                resultSet.getLong(1); //id
                String name = resultSet.getString(2);
                String email = resultSet.getString(3);
                Date birthday = resultSet.getDate(4);
                Integer age = resultSet.getInt(5);
                String home = resultSet.getString(6);
                byte[] uuid = resultSet.getBytes(7);

                Person p = new Person();
                p.setName(name);
                p.setEmail(email);
                p.setUUID(uuid == null ? null : UUID.nameUUIDFromBytes(uuid));
                p.setBirthday(birthday);
                p.setHomepage(home == null ? null : new URL(home));
                p.setAge(age);
            }
        }
    } catch (MalformedURLException e) {
        throw new RuntimeException();
    }
}
 
Example 7
Source File: PageChecksumReadBenchmarks.java    From parquet-mr with Apache License 2.0 4 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.SingleShotTime)
public void read1MRowsGzipWithVerification(Blackhole blackhole) throws IOException {
  readFile(file_1M_CHECKSUMS_GZIP, ONE_MILLION, true, blackhole);
}
 
Example 8
Source File: PageChecksumReadBenchmarks.java    From parquet-mr with Apache License 2.0 4 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.SingleShotTime)
public void read1MRowsSnappyWithoutVerification(Blackhole blackhole) throws IOException {
  readFile(file_1M_CHECKSUMS_SNAPPY, ONE_MILLION, false, blackhole);
}
 
Example 9
Source File: PageChecksumWriteBenchmarks.java    From parquet-mr with Apache License 2.0 4 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.SingleShotTime)
public void write10MRowsGzipWithChecksums() throws IOException {
  pageChecksumDataGenerator.generateData(file_10M_CHECKSUMS_GZIP, 10 * ONE_MILLION, true, GZIP);
}
 
Example 10
Source File: PageChecksumReadBenchmarks.java    From parquet-mr with Apache License 2.0 4 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.SingleShotTime)
public void read100KRowsSnappyWithoutVerification(Blackhole blackhole) throws IOException {
  readFile(file_100K_CHECKSUMS_SNAPPY, 100 * ONE_K, false, blackhole);
}
 
Example 11
Source File: PageChecksumReadBenchmarks.java    From parquet-mr with Apache License 2.0 4 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.SingleShotTime)
public void read10MRowsUncompressedWithVerification(Blackhole blackhole) throws IOException {
  readFile(file_10M_CHECKSUMS_UNCOMPRESSED, 10 * ONE_MILLION, true, blackhole);
}
 
Example 12
Source File: PageChecksumReadBenchmarks.java    From parquet-mr with Apache License 2.0 4 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.SingleShotTime)
public void read10MRowsUncompressedWithoutVerification(Blackhole blackhole) throws IOException {
  readFile(file_10M_CHECKSUMS_UNCOMPRESSED, 10 * ONE_MILLION, false, blackhole);
}
 
Example 13
Source File: PageChecksumWriteBenchmarks.java    From parquet-mr with Apache License 2.0 4 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.SingleShotTime)
public void write1MRowsUncompressedWithChecksums() throws IOException {
  pageChecksumDataGenerator.generateData(file_1M_CHECKSUMS_UNCOMPRESSED, ONE_MILLION, true, UNCOMPRESSED);
}
 
Example 14
Source File: PageChecksumReadBenchmarks.java    From parquet-mr with Apache License 2.0 4 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.SingleShotTime)
public void read10MRowsSnappyWithVerification(Blackhole blackhole) throws IOException {
  readFile(file_10M_CHECKSUMS_SNAPPY, 10 * ONE_MILLION, true, blackhole);
}
 
Example 15
Source File: PageChecksumReadBenchmarks.java    From parquet-mr with Apache License 2.0 4 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.SingleShotTime)
public void read1MRowsGzipWithoutVerification(Blackhole blackhole) throws IOException {
  readFile(file_1M_CHECKSUMS_GZIP, ONE_MILLION, false, blackhole);
}
 
Example 16
Source File: PageChecksumWriteBenchmarks.java    From parquet-mr with Apache License 2.0 4 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.SingleShotTime)
public void write10MRowsGzipWithoutChecksums() throws IOException {
  pageChecksumDataGenerator.generateData(file_10M_NOCHECKSUMS_GZIP, 10 * ONE_MILLION, false, GZIP);
}
 
Example 17
Source File: PageChecksumWriteBenchmarks.java    From parquet-mr with Apache License 2.0 4 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.SingleShotTime)
public void write10MRowsUncompressedWithChecksums() throws IOException {
  pageChecksumDataGenerator.generateData(file_10M_CHECKSUMS_UNCOMPRESSED, 10 * ONE_MILLION, true, UNCOMPRESSED);
}
 
Example 18
Source File: PageChecksumReadBenchmarks.java    From parquet-mr with Apache License 2.0 4 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.SingleShotTime)
public void read1MRowsUncompressedWithVerification(Blackhole blackhole) throws IOException {
  readFile(file_1M_CHECKSUMS_UNCOMPRESSED, ONE_MILLION, true, blackhole);
}
 
Example 19
Source File: JMHSample_02_BenchmarkModes.java    From jmh-playground with Apache License 2.0 4 votes vote down vote up
@Benchmark
@BenchmarkMode({Mode.Throughput, Mode.AverageTime, Mode.SampleTime, Mode.SingleShotTime})
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void measureMultiple() throws InterruptedException {
    TimeUnit.MILLISECONDS.sleep(100);
}
 
Example 20
Source File: PageChecksumWriteBenchmarks.java    From parquet-mr with Apache License 2.0 4 votes vote down vote up
@Benchmark
@BenchmarkMode(Mode.SingleShotTime)
public void write10MRowsSnappyWithChecksums() throws IOException {
  pageChecksumDataGenerator.generateData(file_10M_CHECKSUMS_SNAPPY, 10 * ONE_MILLION, true, SNAPPY);
}