@@ -0,0 +1,2784 @@
+package net.openhft.chronicle.logger;%0A%0Aimport net.openhft.chronicle.Chronicle;%0Aimport net.openhft.chronicle.ExcerptAppender;%0Aimport net.openhft.chronicle.VanillaChronicle;%0Aimport net.openhft.chronicle.tools.ChronicleTools;%0Aimport org.apache.commons.lang3.StringUtils;%0Aimport org.junit.After;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Aimport java.io.IOException;%0Aimport java.util.concurrent.ExecutorService;%0Aimport java.util.concurrent.Executors;%0Aimport java.util.concurrent.TimeUnit;%0A%0A/**%0A * Created by peter on 10/10/14.%0A */%0Apublic class VanillChronicleQueuePerfTest %7B%0A    Chronicle chronicle;%0A    ExcerptAppender logger;%0A%0A    @Before%0A    public void setUp() throws IOException %7B%0A        String baseDir = System.getProperty(%22java.io.tmpdir%22) + %22/perf-binary-vanilla-chronicle%22;%0A        ChronicleTools.deleteDirOnExit(baseDir);%0A        chronicle = new VanillaChronicle(baseDir);%0A        logger = chronicle.createAppender();%0A    %7D%0A%0A    @After%0A    public void tearDown() throws IOException %7B%0A        chronicle.close();%0A    %7D%0A%0A    @Test%0A    public void testMultiThreadLogging() throws IOException, InterruptedException %7B%0A%0A        final int RUNS = 2000000;%0A        final int THREADS = Runtime.getRuntime().availableProcessors();%0A%0A        for (int size : new int%5B%5D%7B64, 128, 256%7D) %7B%0A            %7B%0A                final long start = System.nanoTime();%0A%0A                ExecutorService es = Executors.newFixedThreadPool(THREADS);%0A                for (int t = 0; t %3C THREADS; t++) %7B%0A                    es.submit(new RunnableLogger(RUNS, size));%0A                %7D%0A%0A                es.shutdown();%0A                es.awaitTermination(10, TimeUnit.SECONDS);%0A%0A                final long time = System.nanoTime() - start;%0A%0A                System.out.printf(%22ChronicleLog.MT (runs=%25d, min size=%2503d, elapsed=%25.3f ms) took an average of %25.3f us per entry%5Cn%22,%0A                        RUNS,%0A                        size,%0A                        time / 1e6,%0A                        time / 1e3 / (RUNS * THREADS)%0A                );%0A            %7D%0A        %7D%0A    %7D%0A%0A    protected final class RunnableLogger implements Runnable %7B%0A        private static final String fmtBase = %22 %3E val1=%7B%7D, val2=%7B%7D, val3=%7B%7D%22;%0A        private final String fmt;%0A        private final int runs;%0A%0A        public RunnableLogger(int runs, int pad) %7B%0A            this.runs = runs;%0A            fmt = StringUtils.rightPad(fmtBase, pad + fmtBase.length(), %22X%22);%0A        %7D%0A%0A        @Override%0A        public void run() %7B%0A            for (int i = 0; i %3C this.runs; i++) %7B%0A                logger.startExcerpt();%0A                logger.writeUTF%CE%94(fmt);%0A                logger.writeInt(i);%0A                logger.writeInt(i * 7);%0A                logger.writeInt(i / 16);%0A                logger.finish();%0A            %7D%0A        %7D%0A    %7D%0A%7D%0A

Add performance test for Chronicle Queue