Skip to content

Consider making decodeFromDynamic the default in Kotlin/JS #1894

Open
@swankjesse

Description

@swankjesse

I just landed a 35% performance improvement in my application by replacing this:

Json.decodeFromString(deserializer, string)

with this:

Json.decodeFromDynamic(deserializer, JSON.parse(string))

Would you consider changing decodeFromString() to delegate to JSON.parse() by default? I expect the browser’s built-in implementation to be as-fast or faster most of the time!

(I also replaced Json.encodeToString(serializer, value) with JSON.stringify(Json.encodeToDynamic(serializer, value)).)

Metadata

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