Skip to content

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

Open
@DaanVandenBosch

Description

@DaanVandenBosch

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions