Skip to content

Commit

Permalink
Removed printf statements from performance tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
mvanaken committed Feb 7, 2024
1 parent 6bc9506 commit 981c6e5
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public void brokenByteStream() {
assertThrows(UncheckedIOException.class, () -> Slice.createFromSource(DUMMY_BYTE_STREAM_SOURCE, ZERO, TEN).get().getData());
}


@Test
@Timeout(value=1)
public void byteStreamSourceRead() {
Expand All @@ -60,13 +59,10 @@ public void byteStreamSourceRead() {
// Read from the source in small parts.
final int readSize = 512;
final byte[] valueBytes = new byte[arraySize];
final long start = System.currentTimeMillis();
for (int part = 0; part < arraySize / readSize; part++) {
final byte[] data = source.getData(valueOf(readSize * part), valueOf(readSize));
System.arraycopy(data, 0, valueBytes, readSize * part, data.length);
}
final long end = System.currentTimeMillis();
System.out.printf("Source read: %ss%n", (end - start) / 1000.0);

// Make sure we read the data correctly.
assertArrayEquals(bytes, valueBytes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,10 @@ public void concatenatedValueSourceRead() {
// Read from the source in small parts.
final int readSize = 512;
final byte[] bytesRead = new byte[arraySize];
final long start = System.currentTimeMillis();
for (int part = 0; part < arraySize / readSize; part++) {
final byte[] data = source.getData(valueOf(readSize * part), valueOf(readSize));
System.arraycopy(data, 0, bytesRead, readSize * part, data.length);
}
final long end = System.currentTimeMillis();
System.out.printf("Source read: %ss%n", (end - start) / 1000.0);

// Make sure we read the data correctly.
assertArrayEquals(bytes, bytesRead);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

class ConstantSourceTest {


@Test
@Timeout(value=1)
public void constantSourceRead() {
Expand All @@ -43,13 +42,10 @@ public void constantSourceRead() {
// Read from the source in small parts.
final int readSize = 512;
final byte[] valueBytes = new byte[arraySize];
final long start = System.currentTimeMillis();
for (int part = 0; part < arraySize / readSize; part++) {
final byte[] data = source.getData(valueOf(readSize * part), valueOf(readSize));
System.arraycopy(data, 0, valueBytes, readSize * part, data.length);
}
final long end = System.currentTimeMillis();
System.out.printf("Source read: %ss%n", (end - start) / 1000.0);

// Make sure we read the data correctly.
assertArrayEquals(bytes, valueBytes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,10 @@ public void dataExpressionSourceRead() {
// Read from the source in small parts.
final int readSize = 512;
final byte[] valueBytes = new byte[arraySize];
final long start = System.currentTimeMillis();
for (int part = 0; part < arraySize / readSize; part++) {
final byte[] data = source.getData(valueOf(readSize * part), valueOf(readSize));
System.arraycopy(data, 0, valueBytes, readSize * part, data.length);
}
final long end = System.currentTimeMillis();
System.out.printf("Source read: %ss%n", (end - start) / 1000.0);

// Make sure we read the data correctly.
assertArrayEquals(bytes, valueBytes);
Expand Down

0 comments on commit 981c6e5

Please sign in to comment.