You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@avro.apache.org by GitBox <gi...@apache.org> on 2021/06/18 21:10:35 UTC

[GitHub] [avro] kojiromike commented on pull request #1262: AVRO-2921: Type Fixes for avro.datafile

kojiromike commented on pull request #1262:
URL: https://github.com/apache/avro/pull/1262#issuecomment-864120027


   @RyanSkraba I appreciate someone looking at the work. If you want [to read up](https://docs.python.org/3/reference/datamodel.html#slots), I think implementing `__slots__` may be a potential game-changer for the Python implementation of avro.
   
   They can massively reduce the memory footprint of objects and result in a speed-up, too. `__slots__` are class property declarations that allow the interpreter to pre-allocate memory for the object. The trade-off is that classes with `__slots__` can't have arbitrary properties and there are stricter inheritance rules.
   
   I think implementing slots here makes sense because type hinting requires me to basically enumerate the properties anyway; however, let me know if you think the `__slots__` thing is a bridge too far right now.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org