class ClientsWriteUTF8Bytes {
    static Clients clients;
    static final ObjectMapper mapper = new ObjectMapper();
    static final Gson gson = new Gson();
    static final DslJson<Object> dslJson = new DslJson<>(Settings.withRuntime().includeServiceLoader());
    static final ThreadLocal<ByteArrayOutputStream> bytesOutLocal = ThreadLocal.withInitial(() -> new ByteArrayOutputStream());

    static {
        try {
            InputStream is = ClientsWriteUTF8Bytes.class.getClassLoader().getResourceAsStream("data/jjb/client.json");
            String str = IOUtils.toString(is, "UTF-8");
            clients = JSONReader.of(str)
                    .read(Clients.class);
        } catch (Throwable ex) {
            ex.printStackTrace();
        }
    }

    @Benchmark
    public void fastjson2(Blackhole bh) {
        bh.consume(JSON.toJSONBytes(clients));
    }

    public void jsonb(Blackhole bh) {
        bh.consume(JSONB.toBytes(clients));
    }

    public void jsonb_beanToArray(Blackhole bh) {
        bh.consume(JSONB.toBytes(clients, JSONWriter.Feature.BeanToArray, JSONWriter.Feature.FieldBased));
    }

    public void fastjson2_str(Blackhole bh) {
        bh.consume(JSON.toJSONString(clients));
    }

    @Benchmark
    public void dsljson(Blackhole bh) throws IOException {
        ByteArrayOutputStream bytesOut = bytesOutLocal.get();
        bytesOut.reset();
        dslJson.serialize(clients, bytesOut);
        byte[] bytes = bytesOut.toByteArray();
        bh.consume(bytes);
    }

//    @Benchmark
    public void jackson(Blackhole bh) throws Exception {
        bh.consume(mapper.writeValueAsBytes(clients));
    }

//    @Benchmark
    public void gson(Blackhole bh) throws Exception {
        bh.consume(gson
                .toJson(clients)
                .getBytes(StandardCharsets.UTF_8)
        );
    }

    public static void main(String[] args) throws RunnerException {<FILL_FUNCTION_BODY>}
}

        Options options = new OptionsBuilder()
                .include(ClientsWriteUTF8Bytes.class.getName())
                .mode(Mode.Throughput)
                .timeUnit(TimeUnit.MILLISECONDS)
                .warmupIterations(3)
                .forks(2)
                .threads(16)
                .build();
        new Runner(options).run();
    
<no_super_class>