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

Support option to avoid printing duplicate values #139

Open
rogpeppe opened this issue May 26, 2022 · 0 comments
Open

Support option to avoid printing duplicate values #139

rogpeppe opened this issue May 26, 2022 · 0 comments

Comments

@rogpeppe
Copy link
Contributor

Currently if there are multiple references to a pointer, the entire contents of it are printed each time (unless it's a recursive reference).

This can result in unnecessarily large and hard to read output when an object is shared in many places.

In one recent example, the output was 28MB, but when I changed the code to avoid printing duplicates (by removing the delete(d.pointers, k) line), the output dropped to 280KB, a factor of 100x difference.

This is not necessarily something that would be a good idea to enable by default, because it would require using O(n) memory to keep track of all pointers seen so far, but ISTM that it would be nice to be able to enable de-duplication as an option, at any rate.

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

1 participant