Skip to content

Protobuf java generate to large methods #10247

Open
@Okapist

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions