From fa60e51243c56e6658a91ea63be67a42e22f1512 Mon Sep 17 00:00:00 2001 From: Numerlor <25886452+Numerlor@users.noreply.github.com> Date: Mon, 6 Jul 2020 21:23:41 +0200 Subject: Intern `group_names` --- bot/cogs/doc.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bot/cogs/doc.py b/bot/cogs/doc.py index b288a92b1..0975285e8 100644 --- a/bot/cogs/doc.py +++ b/bot/cogs/doc.py @@ -2,6 +2,7 @@ import asyncio import functools import logging import re +import sys import textwrap from collections import OrderedDict from contextlib import suppress @@ -210,7 +211,9 @@ class Doc(commands.Cog): if "/" in symbol: continue # skip unreachable symbols with slashes absolute_doc_url = base_url + relative_doc_url - group_name = group.split(":")[1] + # Intern the group names since they're reused in all the DocItems + # to remove unnecessary memory consumption from them being unique objects + group_name = sys.intern(group.split(":")[1]) if symbol in self.inventories: symbol_base_url = self.inventories[symbol].url.split("/", 3)[2] -- cgit v1.2.3