Skip to content
Snippets Groups Projects
Commit 17da2cfd authored by Christian Wulf's avatar Christian Wulf
Browse files

final static ArrayWrapper does not improve performance

parent 14d733bb
No related branches found
No related tags found
No related merge requests found
......@@ -2,8 +2,35 @@ package teetime.examples.throughput.methodcall;
public class FixedSizedPipe<T> implements IPipe<T> {
// private static final class ArrayWrapper2<T> {
//
// private final T[] elements;
//
// // private int lastFreeIndex;
//
// @SuppressWarnings("unchecked")
// public ArrayWrapper2(final int initialCapacity) {
// super();
// this.elements = (T[]) new Object[initialCapacity];
// }
//
// public final T get(final int index) {
// return this.elements[index];
// }
//
// public final void put(final int index, final T element) {
// this.elements[index] = element;
// }
//
// public final int getCapacity() {
// return this.elements.length;
// }
//
// }
@SuppressWarnings("unchecked")
private final T[] elements = (T[]) new Object[4];
// private final ArrayWrapper<T> elements = new ArrayWrapper<T>(2);
// private final ArrayWrapper2<T> elements = new ArrayWrapper2<T>(2);
private int lastFreeIndex;
public static <T> void connect(final OutputPort<T> sourcePort, final InputPort<T> targetPort) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment