Skip to content

[rfc] performance improvements #1439

@Nytelife26

Description

@Nytelife26

Relevant issues

Extension of #1374.

Brief

While performance has been improved greatly since the last release, it is still lacking in some key areas. A full demo run on my system takes ~150ms internally, with a lot of time being lost to encoding calls as a result of using str (uncovered in #1436).

See reference 1 for a full overview of profiling data.

References

  1. pyinstrument graph showing profiling data on a demo run

Solution items

  • Defer version imports (perf(cli): import version lazily #1438)
  • Use a static module register Following further profiling, this makes no difference.
  • Read and match against bytes, instead of Python's variable-encoding strs
  • Consider using PCRE2 for patterns requiring lookarounds and backreferences

Metadata

Metadata

Assignees

No one assigned

    Labels

    cat: rfcFeature requests and general proposals

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions