Kris (Backup Account) on Nostr: In which I try to understand Python __slots__. I find that __dict__ is not really ...
https://blog.koehntopp.info/2024/02/19/python-slots.htmlIn which I try to understand Python __slots__.
I find that __dict__ is not really worse than __slots__, which is unexpected.
I also compare Perl, Python and PHP, and find that Python is slightly better than Perl in memory usage per object, which is impressive.
I also find that PHP uses as much memory as I would have Python __dict__ expected to use, but Python optimizes this – PHP does not.
Published at
2024-02-19 17:51:26 UTCEvent JSON
{
"id": "bf6453d82faaf34e6ea3935d481c714ea27b1ec278353c41b15b907ed3610df1",
"pubkey": "6527ed4b3886f3e9a14483f38015e966febecb851259510ff54cb2cebfc4e6fa",
"created_at": 1708365086,
"kind": 1,
"tags": [
[
"proxy",
"https://chaos.social/users/isotopp/statuses/111959414323386884",
"activitypub"
]
],
"content": "https://blog.koehntopp.info/2024/02/19/python-slots.html\n\nIn which I try to understand Python __slots__.\n\nI find that __dict__ is not really worse than __slots__, which is unexpected.\n\nI also compare Perl, Python and PHP, and find that Python is slightly better than Perl in memory usage per object, which is impressive.\n\nI also find that PHP uses as much memory as I would have Python __dict__ expected to use, but Python optimizes this – PHP does not.",
"sig": "dab3aaf122d7ba1ef1cba69e9ce4c2ba0c4be0c511db09b8a12038cab69439f68edd65089153ce24562829210f95fc6b2c941005512c0609b79bb176f94008d8"
}