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

196 lluissalord patch 1 #243

Merged
merged 4 commits into from
Oct 26, 2023
Merged

196 lluissalord patch 1 #243

merged 4 commits into from
Oct 26, 2023

Commits on May 10, 2022

  1. Use __slots__ on NodeMixin to reduce memory usage

    The usage of `__slots__` is highly recommended in order to reduce memory usage on classes, even more for the ones which are used a lot of time as it could be `NodeMixin`. The benefit here is that `__dict__` is not generated then and a lot of memory is saved with this. Besides, with this change any class which inherit `NodeMixin` can now benefit of not creating `__dict__` and reduce the memory usage, otherwise child classes cannot reduce memory with this trick if the parent class does not implement it too.
    
    However, the rest of the classes of this package which inherit from `NodeMixin` should not use `__slots__` because they benefit from the flexibility of `__dict__`. Hence, this benefit is only for implementations which use directly `NodeMixin`, as mine.
    
    In order to set some statistics, in my implementation, the use of this change help us reduce the memory usage of the custom node classes by 49,91% and by 71,85%. Hence, as these classes are highly used on my implementation this can represent a lot of MBs reduction on memory usage.
    lluissalord authored May 10, 2022
    Configuration menu
    Copy the full SHA
    87d1455 View commit details
    Browse the repository at this point in the history

Commits on Oct 26, 2023

  1. Configuration menu
    Copy the full SHA
    8ce0836 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8a6f1e6 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4015a45 View commit details
    Browse the repository at this point in the history