From 9f8eb326af824bba1ff9d12d7c0561748b72a8bb Mon Sep 17 00:00:00 2001 From: serge-sans-paille Date: Tue, 9 Apr 2024 18:05:58 +0000 Subject: [PATCH] Bug 1890540 - Avoid redundant computation of iid_bytes during xpt codegen r=mccr8 Differential Revision: https://phabricator.services.mozilla.com/D207031 --- xpcom/reflect/xptinfo/xptcodegen.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xpcom/reflect/xptinfo/xptcodegen.py b/xpcom/reflect/xptinfo/xptcodegen.py index 3f27009b9dee..1e2cfcb14888 100644 --- a/xpcom/reflect/xptinfo/xptcodegen.py +++ b/xpcom/reflect/xptinfo/xptcodegen.py @@ -9,6 +9,7 @@ import json from collections import OrderedDict import buildconfig +from mozbuild.util import memoize from perfecthash import PerfectHash # Pick a nice power-of-two size for our intermediate PHF tables. @@ -135,6 +136,7 @@ def split_iid(iid): # Get the individual components out of an IID string. return tuple(split_at_idxs(iid, (8, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2))) +@memoize def iid_bytes(iid): # Get the byte representation of the IID for hashing. bs = bytearray() for num in split_iid(iid):