提交 0a260cbd 编写于 作者: G gyfora 提交者: Stephan Ewen

[streaming] speedtest for tuple20 added

上级 a59e2b6d
......@@ -25,13 +25,13 @@ import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.apache.tools.ant.types.CommandlineJava.SysProperties;
import org.junit.Test;
import eu.stratosphere.api.java.tuple.Tuple1;
import eu.stratosphere.api.java.tuple.Tuple2;
import eu.stratosphere.api.java.tuple.Tuple20;
import eu.stratosphere.api.java.tuple.Tuple4;
import eu.stratosphere.api.java.tuple.Tuple5;
......@@ -206,18 +206,42 @@ public class StreamRecordTest {
long t = System.nanoTime();
for (int i = 0; i < ITERATION; i++) {
record.getField(0, 3);
record.getField(0, i%4);
}
long t2 = System.nanoTime() - t;
System.out.println("Tuple5");
System.out.println("getField:\t" + t2 + " ns");
t = System.nanoTime();
for (int i = 0; i < ITERATION; i++) {
record.getFieldFast(0, 3);
record.getFieldFast(0, i%4);
}
t2 = System.nanoTime() - t;
System.out.println("getFieldFast:\t" + t2 + " ns");
StreamRecord record25 = new StreamRecord(new Tuple20<Integer, Long, String, String, String,
String, String, String, String, String,
String, String, String, String, String,
String, String, String, String, String>(0, 42L,"Stratosphere", "Streaming","Stratosphere",
"Stratosphere", "Streaming","Stratosphere", "Streaming", "Streaming",
"Stratosphere", "Streaming","Stratosphere", "Streaming", "Streaming",
"Stratosphere", "Streaming","Stratosphere", "Streaming", "Streaming"));
t = System.nanoTime();
for (int i = 0; i < ITERATION; i++) {
record25.getField(0, i%20);
}
t2 = System.nanoTime() - t;
System.out.println("Tuple20");
System.out.println("getField:\t" + t2 + " ns");
t = System.nanoTime();
for (int i = 0; i < ITERATION; i++) {
record25.getFieldFast(0, i%20);
}
t2 = System.nanoTime() - t;
System.out.println("getFieldFast:\t" + t2 + " ns");
}
@Test
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册