protocolbuffers/protobuf

Protobuf java generate to large methods

Open

#10 247 ouverte le 12 juil. 2022

Voir sur GitHub
 (1 commentaire) (2 réactions) (0 assignés)C++ (16 128 forks)batch import
enhancementhelp wantedjavajava-liteperformance

Métriques du dépôt

Stars
 (71 223 stars)
Métriques de merge PR
 (Merge moyen 2j 11h) (185 PRs mergées en 30 j)

Description

What version of protobuf and what language are you using? Version: main Language: Java

What operating system (Linux, Windows, ...) and version? Any

What runtime / compiler are you using (e.g., python version or gcc version) Any

What did you do? Steps to reproduce the behavior:

Create .proto file with around 1.000 fields like

message LargeMessage { optional string s2 = 2; optional int32 i3 = 3; .... optional string s998 = 998; optional int32 i999 = 99; }

Compile it with protoc

You get too large methods for Java JIT compiler. Default compilation limit is 8000 bytes of byte code. It will work, but in interpreter mode. Very very slow.

What did you expect to see bytecode_estimate calculation and split large methods with MaybeRestartJavaMethod(...)

What did you see instead? Large methods

Additional It may be fixed with some java flags https://stackoverflow.com/questions/57005557/jit-c2-method-maximum-size But it's not good solution. Split large method it's better.

Guide contributeur