-
-
Notifications
You must be signed in to change notification settings - Fork 140
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
Make nodes extensible and weak-referencable #82
Conversation
I did not touch |
Good, that PairSet class is only for internal usage anyway. |
Thanks for sending a PR. Not quite sure if we really should add these to all classes, like |
In order to get a better feeling for the memory penalty, I ran memory_profiler while parsing the big_schema_sdl now, and found that for each of the 3 classes in the ast module, it uses 4% more memory, 12% more in total. I think this is pretty significant already. So I suggest relaxing only the Node class where it makes most sense. What do you think? |
Sure, I can do that. My use case is primarily about |
How do I do the memory profiling? |
What I did was loading the |
Ok, some variations. Using this script, each is an average of 3 sequential runs
Ok, variations:
I was surprised by the memory impact, even between master and variation 3 (presence or removal of I guess I'll go with variation 1, then. |
Thanks a lot for the detailed verification. I agree variation 1 is the best compromize. |
This should decrease the memory impact of this PR from +11% to +4%.
Ok, I think that's all squared away. |
Add standard dunder attributes to (almost) all instances of
__slots__
Using the test suite as a benchmark, this change produced no noticeable slow down.
Closes #81