package com.github.davidmoten.rx;

import org.openjdk.jmh.annotations.Benchmark;

import rx.Observable;

public class Benchmarks {

    private static final int MANY = 1000000;

    @Benchmark
    public void takeLastOneFromRxJavaLibraryMany() {
        Observable.range(1, MANY).takeLast(1).subscribe();
    }

}

@@ -28,16 +28,97 @@
 en.rx;%0A%0A
+import java.util.ArrayList;%0Aimport java.util.LinkedList;%0Aimport java.util.List;%0A%0A
 import o
@@ -386,10 +386,466 @@
 %0A    %7D%0A%0A
+    @Benchmark%0A    public void addAndIterateArrayList() %7B%0A        addAndIterateList(new ArrayList%3CInteger%3E());%0A    %7D%0A%0A    @Benchmark%0A    public void addAndIterateLinkedList() %7B%0A        addAndIterateList(new LinkedList%3CInteger%3E());%0A    %7D%0A%0A    private void addAndIterateList(List%3CInteger%3E list) %7B%0A        list.add(1);%0A        list.add(2);%0A        list.add(3);%0A        list.add(4);%0A        list.add(5);%0A        for (Integer elmeent : list) %7B%0A        %7D%0A    %7D%0A%0A
 %7D%0A

add benchmark comparing linkedlist with arraylist