Skip to content

Improve startup time. #32

Closed
Closed
@markshannon

Description

@markshannon

Before we attempt this, we need to know where the time is spent.
@ericsnowcurrently Do you have any profiling information from running python -S -c "print('Hi')", or a similar script?

It takes about 10 ms on my machine for 3.9 which seems a long time to print "Hi".
For comparison, 2.7 takes about 7ms.

I suspect there is a lot of incidental stuff going on that we can eliminate.

The tasks that have to be performed to run python -S -c "print('Hi')" are:

  • Load executable from disk (it should be in memory cache, but it still needs work by the O/S).
  • Build config object from command line and environment variables
  • Create a new interpreter
  • Create a new thread
  • Compile (including parsing) print(Hi")
  • Execute print(Hi")
  • Dispose of thread
  • Dispose of interpreter

None of those tasks should take long, so what is slow?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions