Path 1: 38 calls (0.59)

'{"test":"test"}' (6) '{"_flashes":[{" t":["message","Hello World"]},{" t":["error","Hello World"]},{" t":["warning",{" m":"Testing"}]}]}' (4...

dict (38)

dict (7) {'test': 'test'} (6) {'testing': 42} (3) {'data': 'foo'} (3) {'value': '42'} (2) {'_permanent': True, 'test': 42} (2) {'_permanent': True, 'f...

1def loads(s: str | bytes, **kwargs: t.Any) -> t.Any:
2    """Deserialize data as JSON.
3
4    If :data:`~flask.current_app` is available, it will use its
5    :meth:`app.json.loads() <flask.json.provider.JSONProvider.loads>`
6    method, otherwise it will use :func:`json.loads`.
7
8    :param s: Text or UTF-8 bytes.
9    :param kwargs: Arguments passed to the ``loads`` implementation.
10
11    .. versionchanged:: 2.3
12        The ``app`` parameter was removed.
13
14    .. versionchanged:: 2.2
15        Calls ``current_app.json.loads``, allowing an app to override
16        the behavior.
17
18    .. versionchanged:: 2.0
19        ``encoding`` will be removed in Flask 2.1. The data must be a
20        string or UTF-8 bytes.
21
22    .. versionchanged:: 1.0.3
23        ``app`` can be passed directly, rather than requiring an app
24        context for configuration.
25    """
26    if current_app:
27        return current_app.json.loads(s, **kwargs)
28
29    return _json.loads(s, **kwargs)
            

Path 2: 26 calls (0.41)

bytes (15) '{" di":{" t__":{" t":[1,2,3]}}}' (1) '{" t__":{" b":"YQ=="}}' (1) '{" di":{" di__":" di"}}' (1) '{"x":{" t":[1,2,3]},"y":4}' (1) '{" t":[1...

{} (15) dict (11)

dict (5) list (3) 0 (1) -1 (1) 1 (1) 23 (1) 3.14 (1) 's' (1) 'longer string' (1) True (1)

1def loads(s: str | bytes, **kwargs: t.Any) -> t.Any:
2    """Deserialize data as JSON.
3
4    If :data:`~flask.current_app` is available, it will use its
5    :meth:`app.json.loads() <flask.json.provider.JSONProvider.loads>`
6    method, otherwise it will use :func:`json.loads`.
7
8    :param s: Text or UTF-8 bytes.
9    :param kwargs: Arguments passed to the ``loads`` implementation.
10
11    .. versionchanged:: 2.3
12        The ``app`` parameter was removed.
13
14    .. versionchanged:: 2.2
15        Calls ``current_app.json.loads``, allowing an app to override
16        the behavior.
17
18    .. versionchanged:: 2.0
19        ``encoding`` will be removed in Flask 2.1. The data must be a
20        string or UTF-8 bytes.
21
22    .. versionchanged:: 1.0.3
23        ``app`` can be passed directly, rather than requiring an app
24        context for configuration.
25    """
26    if current_app:
27        return current_app.json.loads(s, **kwargs)
28
29    return _json.loads(s, **kwargs)