Uploaded image for project: 'Picard'
  1. Picard
  2. PICARD-974

Use __Slots__ to speed up key classes and reduce memory usage

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Icon: Normal Normal
    • None
    • 1.4
    • Other
    • None

      Use of _slots_ for known variables is supposed to help reduce memory usage in classes and to some extent speed up execution.

      "By default, instances of both old and new-style classes have a dictionary for attribute storage. This wastes space for objects having very few instance variables. The space consumption can become acute when creating large numbers of instances."

      So this may be an issue for users who load large numbers of files.

      See https://docs.python.org/2/reference/datamodel.html#slots

            Unassigned Unassigned
            sophist Sophist
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package