@@ -0,0 +1,2464 @@
+/*%0A * Copyright 2016-2022 chronicle.software%0A *%0A *       https://chronicle.software%0A *%0A * Licensed under Contract only%0A */%0A%0Apackage net.openhft.chronicle.wire.channel;%0A%0Aimport net.openhft.chronicle.bytes.MethodReader;%0Aimport net.openhft.chronicle.wire.channel.echo.DummyData;%0Aimport net.openhft.chronicle.wire.channel.echo.EchoHandler;%0A%0Aimport java.util.concurrent.atomic.AtomicLong;%0A%0Apublic class PerfThroughputMain %7B%0A    static final int RUN_TIME = Integer.getInteger(%22runTime%22, 5);%0A    static final String URL = System.getProperty(%22url%22, %22tcp://:1248%22);%0A%0A    public static void main(String%5B%5D args) %7B%0A        try (ChronicleContext context = ChronicleContext.newContext(URL)) %7B%0A            EchoHandler echoHandler = new EchoHandler();%0A            final ChronicleChannelSupplier supplier = context.newChannelSupplier(echoHandler);%0A            ChronicleChannel channel = supplier.get();%0A%0A            doTest(%22unbuffered%22, channel);%0A%0A            echoHandler.buffered(true);%0A            ChronicleChannel channel2 = supplier.buffered(true).get();%0A%0A            doTest(%22buffered%22, channel2);%0A        %7D%0A    %7D%0A%0A    private static void doTest(String desc, ChronicleChannel channel) %7B%0A        DummyData data = new DummyData();%0A        for (int size = 32 %3C%3C 10; size %3E= 8; size /= 2) %7B%0A            data.data(new byte%5Bsize - Long.BYTES%5D);%0A            long start = System.currentTimeMillis();%0A            long end = start + RUN_TIME * 1000L;%0A            final Echoing echoing = channel.methodWriter(Echoing.class);%0A            long count = 0;%0A            AtomicLong unread = new AtomicLong(0);%0A            MethodReader reader = channel.methodReader((Echoing) d -%3E %7B%0A                unread.getAndDecrement();%0A            %7D);%0A            int window = (1 %3C%3C 20) / size;%0A            do %7B%0A                echoing.echo(data);%0A                unread.getAndIncrement();%0A                count++;%0A                do %7B%0A                    reader.readOne();%0A                %7D while (unread.get() %3E window);%0A            %7D while (System.currentTimeMillis() %3C end);%0A            do %7B%0A                reader.readOne();%0A            %7D while (unread.get() %3E 0);%0A            long time = System.currentTimeMillis() - start;%0A            long totalBytes = size * count;%0A            long MBps = totalBytes / time / (1_000_000 / 1_000);%0A            long rate = count * 1000 / time;%0A            System.out.println(%22desc: %22 + desc + %22, size: %22 + size + %22, MBps: %22 + MBps+%22, mps: %22+rate);%0A        %7D%0A    %7D%0A%7D%0A

Add a single channel throughput test