performance: Cache some properties

This commit is contained in:
James Westman 2023-03-20 13:34:17 -05:00
parent 3f27e92eb0
commit 402677f687
No known key found for this signature in database
GPG key ID: CE2DBA0ADB654EA6
2 changed files with 13 additions and 9 deletions

View file

@ -17,6 +17,7 @@
#
# SPDX-License-Identifier: LGPL-3.0-or-later
from functools import cached_property
from .. import gir
from .imports import GtkDirective, Import
@ -82,7 +83,7 @@ class UI(AstNode):
or isinstance(child, Menu)
]
@property
@cached_property
def objects_by_id(self):
return {
obj.tokens["id"]: obj