alexmojaki / alexmojaki/cheap_repr

Is it possible to lazy load the repr handlers?

Aperta
#16 8 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
26
Fork
5
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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](https://user-images.githubusercontent.com/2592205/99042974-7e2ed600-2542-11eb-9b7e-60b6d23708f7.png)

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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.