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

Deserialization of enums without @Serializable annotation is extremely slow in Kotlin JS #1385

Open
DaanVandenBosch opened this issue Mar 23, 2021 · 0 comments
Assignees

Comments

@DaanVandenBosch
Copy link

I currently have some code that takes 3 seconds to deserialize an array of 4304 objects with 4 enum properties. When I turn the enum properties into String properties it takes about 120 milliseconds.

Annotating the enums makes it about as fast as the string version (every enum property adds about 10ms). Writing custom serializers for enums from a library is equally fast.

It seems like performance for annotated and non-annotated enums should be similar, or is that not possible?

Expected behavior

Good performance.

Environment

  • Kotlin version: 1.4.31
  • Library version: 1.1.0
  • Kotlin platforms: JS
  • Gradle version: 6.8.2
  • Browser: Chrome
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

3 participants