Project

General

Profile

Feature #21505

Updated by Peter Amstutz about 1 month ago

Because these are the classes that arv-mount might instantiate several thousand of, defining @__slots__@ could make for a noticeable improvement in memory use at little cost. 

 Note that @__slots__@ needs to be defined on all classes to get the full benefit. Subclasses that add no attributes to their parents need to say @__slots__ = ()@. 

 #21541 added slots to the most commonly instantiated classes in arvados_fuse.fusedir.    The following still need to have @__slots__@ defined: 

 * TmpCollectionDirectory 
 * UnsaveableCollection 
 * MagicDirectory 
 * TagsDirectory 
 * TagDirectory 
 * SharedDirectory 

 In addition, a number of classes in arvados.collection would benefit from defining @__slots__@ 

 * CollectionBase 
 * RichCollectionBase 
 * Collection 
 * Subcollection 
 * CollectionReader 

Back