+
Skip to content

Is it possible to lazy load the repr handlers? #16

Open
@laike9m

Description

@laike9m

When profiling my program, I find that importing cheap_repr is very expensive. Here's one profiling result using py-spy:

https://laike9m.github.io/images/af9b0d4.svg

image

Importing cheap_repr took ~8% of the total time. In __init__.py, it seems that it should be possible to make @try_register_repr calls lazy. Especially for registering Pandas handlers, they took most of the time. This becomes worse when users have Pandas installed but didn't really call cheap_repr on Pandas objects.

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

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载