Skip to content

Re-use old indent in json.loads() #118299

Closed as not planned
Closed as not planned

Description

@nineteendo

Feature or enhancement

Proposal:

Currently the indent is generated from scratch for each depth:

_current_indent_level += 1
newline_indent = '\n' + _indent * _current_indent_level

We can easily re-use the old indent:

newline_indent = old_newline_indent + _indent

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Linked PRs

Activity

  1. serhiy-storchaka commented on Apr 26, 2024

    @serhiy-storchaka
    Member

    Could you show any benchmark results?

  2. nineteendo commented on Apr 26, 2024

    @nineteendo
    ContributorAuthor

    See the pull request: #118300 (comment)

  3. nineteendo commented on May 7, 2024

    @nineteendo
    ContributorAuthor

    Do we close this? Or did you mean I could leave it at concatenation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-featureA feature request or enhancement

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions