Changaco / python-libarchive-c

Python interface to libarchive
Other
70 stars 37 forks source link

Optimize the `ArchiveEntry` class #94

Closed Changaco closed 4 years ago

Changaco commented 5 years ago

Defining __slots__ improves memory usage and speed.

Changaco commented 5 years ago

Not sure if I should add a __dict__ slot or not. Does anyone reading this comment attach custom attributes to the ArchiveEntry objects created by this library?

Edit: I decided not to add a __dict__ slot. We should support using a subclass of ArchiveEntry instead.