package ca.junctionbox.cljbuck.lexer.benchmarks;

import ca.junctionbox.cljbuck.lexer.Item;
import ca.junctionbox.cljbuck.lexer.Lexable;
import org.jcsp.lang.CSProcess;
import org.jcsp.lang.Channel;
import org.jcsp.lang.ChannelInput;
import org.jcsp.lang.One2OneChannel;
import org.jcsp.lang.Parallel;
import org.jcsp.util.Buffer;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.runner.Runner;
import org.openjdk.jmh.runner.RunnerException;
import org.openjdk.jmh.runner.options.Options;
import org.openjdk.jmh.runner.options.OptionsBuilder;

import java.util.LinkedList;
import java.util.Queue;

public class LexerBenchmark {

    @Benchmark
    public void BenchmarkLexer() {
        final One2OneChannel<Object> chan = Channel.one2one(new Buffer(2048));
        final Lexable l = Lexable.create("comment.clj",
                "(ns my.core (:require [hello.world.extended :as ext])\n\n\n(defn hello [name]\n (prn \"Hola \" name))", chan.out());

        ConsumeTask task = new ConsumeTask(chan.in());

        new Parallel(new CSProcess[]{
                (CSProcess) l,
                task,
        }).run();
    }

    public static void main(String[] args) throws RunnerException {
        Options opt = new OptionsBuilder()
                .include(LexerBenchmark.class.getSimpleName())
                .forks(1)
                .build();

        new Runner(opt).run();
    }
}

class ConsumeTask implements CSProcess {
    final Queue<Item> items = new LinkedList<>();
    private final ChannelInput<Object> in;

    ConsumeTask(ChannelInput<Object> in) {
        this.in = in;
    }

    @Override
    public void run() {
        for (;;) {
            final Item item = (Item) in.read();
            if (item == null) {
                break;
            }
            items.add(item);
        }
    }
}
package ca.junctionbox.cljbuck.lexer.benchmarks;

import ca.junctionbox.cljbuck.lexer.Item;
import ca.junctionbox.cljbuck.lexer.Lexable;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.runner.Runner;
import org.openjdk.jmh.runner.RunnerException;
import org.openjdk.jmh.runner.options.Options;
import org.openjdk.jmh.runner.options.OptionsBuilder;

import java.util.LinkedList;
import java.util.Queue;

public class LexerBenchmark {
    /*
    @Benchmark
    public void BenchmarkLexer() {
        final One2OneChannel<Object> chan = Channel.one2one(new Buffer(2048));
        final Lexable l = Lexable.create("comment.clj",
                "(ns my.core (:require [hello.world.extended :as ext])\n\n\n(defn hello [name]\n (prn \"Hola \" name))", chan.out());

        ConsumeTask task = new ConsumeTask(chan.in());

        new Parallel(new CSProcess[]{
                (CSProcess) l,
                task,
        }).run();
    }

    public static void main(String[] args) throws RunnerException {
        Options opt = new OptionsBuilder()
                .include(LexerBenchmark.class.getSimpleName())
                .forks(1)
                .build();

        new Runner(opt).run();
    }
    */
}

Remove JCSP cruft from Benchmark.