Skip to content
This repository has been archived by the owner on Apr 14, 2022. It is now read-only.

Prefer stub content when stub is available #1845

Open
wants to merge 136 commits into
base: master
Choose a base branch
from

Conversation

MikhailArkhipov
Copy link

Fixes #1821

Prefer stub content when stub is available. Don't eval content beyond documentation. Increases analysis speed 20-50% depending on how many stubs are available.

MikhailArkhipov added 30 commits September 30, 2019 12:03
@jakebailey
Copy link
Member

How does this work with partial stubs? Our typeshed is still an old copy (missing 3.8 stuff), and we bundle small targeted stubs for numpy. Does this only apply for stubs shipped directly with libraries?

@MikhailArkhipov
Copy link
Author

Change is limited to typeshed modules only. Numpy is not there so it is analyzed same way as before. Only stubs from typeshed are considered.

@MikhailArkhipov
Copy link
Author

Regular on import numpy

Analysis complete: 933 modules in 8785.63 ms.
Analysis version 1624 of 932 entries has been completed in 5851.16 ms.

with stubsOnly: true

Analysis complete: 933 modules in 6685.23 ms.
Analysis version 1640 of 933 entries has been completed in 4446.48 ms.

@MikhailArkhipov
Copy link
Author

MikhailArkhipov commented May 4, 2020

import sys
import os
import datetime

Regular:

Analysis complete: 348 modules in 6099.82 ms.
Analysis version 574 of 309 entries has been completed in 2703.78 ms.

with stubsOnly: true

Analysis complete: 348 modules in 3079.24 ms.
Analysis version 574 of 334 entries has been completed in 1461.81 ms.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optimize analysis of modules when stub is available
2 participants