@@ -0,0 +1,2679 @@
+/**%0A * Copyright 2010 - 2017 JetBrains s.r.o.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A * http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage jetbrains.exodus.benchmark.dataStructures.persistent;%0A%0Aimport jetbrains.exodus.core.dataStructures.persistent.PersistentBitTreeLongSet;%0Aimport jetbrains.exodus.core.dataStructures.persistent.PersistentLong23TreeSet;%0Aimport jetbrains.exodus.core.dataStructures.persistent.PersistentLongSet;%0Aimport org.openjdk.jmh.annotations.*;%0A%0Aimport java.util.TreeMap;%0Aimport java.util.concurrent.TimeUnit;%0A%0Aimport static jetbrains.exodus.benchmark.dataStructures.persistent.JMHPersistentLongSetBenchmark.MAP_SIZE;%0A%0A@State(Scope.Thread)%0A@OutputTimeUnit(TimeUnit.SECONDS)%0Apublic class JMHPersistentLongSetFillBenchmark %7B%0A    private final PersistentLongSet treeSet = new PersistentLong23TreeSet();%0A    private final PersistentLongSet bitTreeSet = new PersistentBitTreeLongSet();%0A%0A    private final TreeMap%3CLong, Object%3E juTree = new TreeMap%3C%3E();%0A    private final Object value = new Object();%0A%0A    private final long%5B%5D keys = new long%5B(int) MAP_SIZE%5D;%0A%0A    @Setup%0A    public void prepare() %7B%0A        for (int i = 0; i %3C MAP_SIZE; ++i) %7B%0A            keys%5Bi%5D = (long) (i * 2);%0A        %7D%0A    %7D%0A%0A%0A    @Benchmark%0A    @Warmup(iterations = 4, time = 1)%0A    @Measurement(iterations = 6, time = 1)%0A    @Fork(5)%0A    public Object fillTreeMap() %7B%0A        for (int i = 0; i %3C MAP_SIZE; ++i) %7B%0A            juTree.put(keys%5Bi%5D, value);%0A        %7D%0A        return juTree;%0A    %7D%0A%0A    @Benchmark%0A    @Warmup(iterations = 4, time = 1)%0A    @Measurement(iterations = 6, time = 1)%0A    @Fork(5)%0A    public Object fill23Tree() %7B%0A        final PersistentLongSet.MutableSet mutableTreeSet = treeSet.beginWrite();%0A        for (int i = 0; i %3C MAP_SIZE; ++i) %7B%0A            mutableTreeSet.add(keys%5Bi%5D);%0A        %7D%0A        return mutableTreeSet;%0A    %7D%0A%0A    @Benchmark%0A    @Warmup(iterations = 4, time = 1)%0A    @Measurement(iterations = 6, time = 1)%0A    @Fork(5)%0A    public Object fillBitTree() %7B%0A        final PersistentLongSet.MutableSet mutableTreeSet = bitTreeSet.beginWrite();%0A        for (int i = 0; i %3C MAP_SIZE; ++i) %7B%0A            mutableTreeSet.add(keys%5Bi%5D);%0A        %7D%0A        return mutableTreeSet;%0A    %7D%0A%7D%0A

add JMHPersistentLongSetFillBenchmark