Skip to content

Poor performances with big primitive arrays #128

@CGNonofr

Description

@CGNonofr

When comparing big number array with only a single difference, the command takes a lot of times to run.

How to reproduce

Generate a json containing a 10000 items array

jq -n --argjson items "$(shuf -i 0-9999 -n 10000 | jq -cs '.')" '{"items": $items}' > data.json

Run the jd on the generated file and a slightly modified json

cat data.json | jq '.items[503] = (input | tonumber)' <<< "$(shuf -i 0-9999 -n 1)" | jd data.json

Expected behavior

A patch is generated in a few milliseconds

Actual behavior

The command runs for more than 10 seconds before giving the result

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions