aboutsummaryrefslogtreecommitdiff
path: root/discord/abc.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2021-07-05 21:01:40 -0400
committerRapptz <[email protected]>2021-07-07 20:19:17 -0400
commitcb2363f0fd819ce1a5c38b42cd403fcb8994be6f (patch)
tree6aa3da75e04496a52aa68fbd3a15f7da9337bc72 /discord/abc.py
parentAllow use of orjson instead of json (diff)
downloaddiscord.py-cb2363f0fd819ce1a5c38b42cd403fcb8994be6f.tar.xz
discord.py-cb2363f0fd819ce1a5c38b42cd403fcb8994be6f.zip
Move global user storage from WeakValueDictionary to dict
Profiling showed that WeakValueDictionary caused rather significant and noticeable slowdowns during startup. Since the only thing it was used for was to automatically remove the key from the mapping when the reference count reaches zero, the same could theoretically be accomplished by using the __del__ special method. There is a chance that this could lead to a memory leak since the __del__ method is not always called, but the only instances of this happening are during interpreter shutdown to my knowledge and at that point the mapping is the least of my concern.
Diffstat (limited to 'discord/abc.py')
0 files changed, 0 insertions, 0 deletions