Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not call Enum.values() on each call to decodeEnumValue for explicitly-serializable enums #1372

Closed
qwwdfsad opened this issue Mar 15, 2021 · 1 comment
Assignees

Comments

@qwwdfsad
Copy link
Member

Steps to reproduce:

@Serializable
enum class AnnotatedEnum {
    E1,
    E2
}

Its serializer.deserialize code contains the following sequence: AnnotatedEnum.values()[decoder.decodeEnum($$serialDesc)]; It triggers an allocation of values array on each call.

The desired behaviour is to pre-cache this array in serializer's state

@shanshin shanshin self-assigned this Sep 28, 2021
@shanshin
Copy link
Contributor

shanshin commented Aug 1, 2022

Fixed via #1851

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

No branches or pull requests

2 participants