@@ -0,0 +1,2875 @@
+package org.archive.util.binsearch;%0Aimport java.io.BufferedReader;%0Aimport java.io.File;%0Aimport java.io.IOException;%0Aimport java.io.InputStreamReader;%0A%0Aimport org.archive.url.WaybackURLKeyMaker;%0Aimport org.archive.util.binsearch.impl.MappedSeekableLineReaderFactory;%0Aimport org.archive.util.binsearch.impl.NIOSeekableLineReaderFactory;%0Aimport org.archive.util.binsearch.impl.NIOSeekableLineReaderFactory.NIOType;%0Aimport org.archive.util.binsearch.impl.RandomAccessFileSeekableLineReaderFactory;%0Aimport org.archive.util.iterator.CloseableIterator;%0A%0A%0Apublic class SeekCDXBenchmarker %7B%0A%0A    /**%0A     * @param args%0A     * @throws IOException %0A     */%0A    public static void main(String%5B%5D args) throws IOException %7B%0A        %0A        long startTime = 0;%0A        %0A        try %7B%0A            startTime = System.currentTimeMillis();%0A            %0A            String uri = args%5B0%5D;%0A            String type = %22bio%22;%0A            int blocksize = SeekableLineReaderFactory.BINSEARCH_BLOCK_SIZE;%0A            %0A            if (args.length %3E 1) %7B%0A                type = args%5B1%5D;%0A            %7D%0A            %0A            if (args.length %3E 2) %7B%0A                blocksize = Integer.parseInt(args%5B2%5D);%0A            %7D%0A            %0A            SeekableLineReaderFactory factory = null;%0A            %0A            if (type.equals(%22bio%22)) %7B%0A                factory = new RandomAccessFileSeekableLineReaderFactory(new File(uri), blocksize);%0A            %7D else if (type.equals(%22nio%22)) %7B%0A                factory = new NIOSeekableLineReaderFactory(new File(uri), blocksize, NIOType.PLAIN);%0A            %7D else if (type.equals(%22mmap%22)) %7B%0A                factory = new NIOSeekableLineReaderFactory(new File(uri), blocksize, NIOType.MMAP);%0A            %7D else if (type.equals(%22bigmap%22)) %7B%0A                factory = new MappedSeekableLineReaderFactory(new File(uri));%0A            %7D%0A            %0A            SortedTextFile sorted = new SortedTextFile(factory);%0A            sorted.setBinsearchBlockSize(blocksize);%0A            %0A            BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));%0A            %0A            WaybackURLKeyMaker keymaker = new WaybackURLKeyMaker(true);%0A            %0A            String next = null;%0A            %0A            while ((next = reader.readLine()) != null) %7B%0A                %0A                try %7B%0A                    next = keymaker.makeKey(next);%0A                %7D catch (Exception e) %7B%0A                    continue;%0A                %7D%0A                %0A                CloseableIterator%3CString%3E iter = sorted.getRecordIterator(next);%0A                if (iter.hasNext()) %7B%0A                    System.out.println(iter.next());%0A                %7D%0A                iter.close();%0A            %7D%0A        %7D finally %7B%0A            System.out.println(%22=========%22);%0A            System.out.println(%22Total Time: %22 + (System.currentTimeMillis() - startTime));%0A        %7D%0A    %7D%0A%7D%0A

Add benchmarker class