Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On Ubuntu 16.04, with Python 2.7, performance impact is non-trivial #27

Open
anandr165 opened this issue May 2, 2019 · 3 comments
Open

Comments

@anandr165
Copy link

Without adding hook to my module (tgv):

Traceback (most recent call last):
File "./tgv.py", line 618, in
if name == "main": tgv()
File "./tgv.py", line 426, in tgv
1/0
ZeroDivisionError: integer division or modulo by zero

real 0m2.904s
user 0m2.344s
sys 0m0.536s

With hook added

Traceback (most recent call last):
File "./tgv.py", line 618, in
if name == "main": tgv()
<6 variables printed>
File "./tgv.py", line 426, in tgv
1/0
<20 odd variables>
ZeroDivisionError: integer division or modulo by zero

real 0m30.856s
user 0m29.192s
sys 0m1.572s

I'm guessing mostly the perf degradation is due to the high count of variables being printed.
Anyway to control the output?

@skorokithakis
Copy link
Owner

Hmm, does it really print that many variables? The goal is to print enough to be relevant, not to inundate the user. Can you post a sample of the output?

@anandr165
Copy link
Author

Sorry I cant print the details but more than half the variables are lists & dictionaries of nearly 100,000 entries of small strings.

@alexmojaki
Copy link

To improve the performance of printing large variables, I suggest https://github.com/alexmojaki/cheap_repr

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

No branches or pull requests

3 participants