After GC and syscalls, io.netty.handler.codec.http2.DefaultHttp2HeadersEncoder.encodeHeaders takes the most CPU on a simple ping pong stress test. It accounts for about 3.3% of total program time. The offending line is:
https://github.com/netty/netty/blob/83c349ffa94d3992c4ee511d3625afc0c97c12bb/codec-http2/src/main/java/io/netty/handler/codec/http2/DefaultHttp2HeadersEncoder.java#L68
I am not sure why this is so slow, but we should probably investigate it. My test does nothing special with headers.