Skip to content

Performance issue decoding large arrays. #84

@em

Description

@em

Decoding is extremely slow with large arrays:

try it:

@decco
type t = {ids: array<string>}

Js.Console.timeStart("noneofthisisslow")
let bigboi = {ids: Belt.Array.makeBy(100000, i => i->string_of_int)}
let json = bigboi->Js.Json.stringifyAny->Belt.Option.getExn->Js.Json.parseExn

Js.Console.timeEnd("noneofthisisslow")

Js.Console.timeStart("yusoslow")
let _ = t_decode(json)
Js.Console.timeEnd("yusoslow")

Js.Console.log("what gives?")
noneofthisisslow: 50.296ms
yusoslow: 6.616s
what gives?

Doing batch processing of millions of records in nodejs and found decco of all things locking up the event loop causing timeouts elsewhere, sometimes blocking for minutes in our case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions