From cfa7278568aac6d00393bfa521b79e302d8e05f0 Mon Sep 17 00:00:00 2001 From: Gleb Smirnov Date: Sat, 19 Feb 2022 12:59:42 +0300 Subject: [PATCH] perf: cache action widgets to don't recalculate it --- blueprintcompiler/language/gobject_object.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/blueprintcompiler/language/gobject_object.py b/blueprintcompiler/language/gobject_object.py index f5dbc12..6d1aa66 100644 --- a/blueprintcompiler/language/gobject_object.py +++ b/blueprintcompiler/language/gobject_object.py @@ -19,8 +19,10 @@ import typing as T -from .response_id import ResponseId +from functools import cached_property + from .common import * +from .response_id import ResponseId class ObjectContent(AstNode): @@ -81,7 +83,7 @@ class Object(AstNode): if self.gir_class: return self.gir_class.doc - @property + @cached_property def action_widgets(self) -> T.List[ResponseId]: """Get list of widget's action widgets.