Skip to content

Java: expose specialized primitive collections (IntList) to avoid auto-boxing #11006

Open
@Krumpet

Description

fastutil offers data structures for primitive Java types that are smaller in size and faster for reading and mutating. If protoc used e.g. IntArrayList rather than ArrayList<Integer> and provided getInt() then boxing and unboxing could be avoided.

What language does this apply to?
generated Java code

Describe the problem you are trying to solve.
improve read/write performance and size of proto messages

Describe the solution you'd like
utilize data structures provided in fastutil (or another package providing similar benefits) and provide the richer get API so client code can work with unboxed primitives as much as possible.

Describe alternatives you've considered
For smaller collections the difference is negligible, for larger ones we convert them from the source proto object so the penalty of using the regular ArrayList<Integer> is minimized

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