grpc / grpc/grpc-java

DefaultHttp2HeadersEncoder.encodeHeaders are slow

Offen
#1,670 6 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
performance
Vorherrschende Sprache
Java
Sterne
12.1k
Forks
4k
Ø Merge
2 T. 17 Std.
Gemergte PRs (30 T.)
37

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Start at io.netty.handler.codec.http2.DefaultHttp2HeadersEncoder.encodeHeaders in codec-http2/src/main/java/io/netty/handler/codec/http2/DefaultHttp2HeadersEncoder.java, around line 68, and reproduce the simple ping-pong stress test described in the issue. Profile the method to investigate the reported 3.3% CPU share. Done means the cause is identified and a validated performance improvement or clear conclusion is recorded.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
java
Bereich
backend-api-design, performance
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.