Skip to content

Parsing optimization or lazy loadingΒ #1432

Open
@zhimbura

Description

@zhimbura

I have a serious performance issue when parsing.

To demonstrate how it works, I wrote the following code to compare the performance of native JSON.parse and Json { ignoreUnknownKeys = true }.decodeFromString

image

After that, I perform a time measurement via chrome profile and get this result

Json { ignoreUnknownKeys = true }.decodeFromString 1.92s
image

JSON.parse 23ms
image

Is it possible to somehow speed up the work? Use partial JSON.parse in js implementation?
For example, create a Kotlin DTO class and populate it like this?

@Serializable
class Foo {
  val bas: String
}
let parseData = JSON.parse ('{"bas": "hello"}')
Object.assing (new Foo (), parseData)

is it possible to somehow speed it up?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions