Skip to content

jsonpath-rw find function is slow? #95

@god-chaos

Description

@god-chaos

test code:

from jsonpath_rw import parse as parserw


@exec_time()
def test_jsonpathrw(data, field):
    jsonpath_expr = parserw(field)
    return jsonpath_expr.find(data)


js = {'z': [{'z1': 10}, {'z1': 20}]}
print(test_jsonpathrw(js, 'z')[0].value)

output is:

func:{test_jsonpathrw} exec time is:{9.79468} ms
[{'z1': 10}, {'z1': 20}]

just find 'z' node of the very simple json object. find function is so slowly. it can be work?

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