Skip to content

Async is slow due to isawaitable use #1514

@mohd-akram

Description

@mohd-akram

I was benchmarking a render and I noticed that the use of inspect.isawaitable really slows things down:

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
    22920    0.024    0.000    0.059    0.000 .../python3.10/inspect.py:348(isawaitable)

Almost 60 milliseconds is spent there, more than any other Python builtin in the profile.

Environment:

  • Python version: 3.10
  • Jinja version: 3.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions