Skip to content

auto import is very slow #25

@izhengzhixian

Description

@izhengzhixian
all_text = '"v1Cd5Yk6x_f2cqrqNV6Iy_1ab34_dfI" + l'
modules = re.findall(r'([\w.]+)+(?=\.\w+)\b', all_text)

When the code contains the above text, it will be executed for several minutes when searching for module.
After changing to the following regex, it will be executed very quickly.

all_text = '"v1Cd5Yk6x_f2cqrqNV6Iy_1ab34_dfI" + l'
modules = re.findall(r'(?<!\w)([a-zA-Z_]\w*)\.\w+\b', all_text)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions