From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1271548-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id A319E13835A
	for <garchives@archives.gentoo.org>; Fri, 16 Apr 2021 03:39:24 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id A6AB5E07DB;
	Fri, 16 Apr 2021 03:39:23 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 5FB68E07D7
	for <gentoo-commits@lists.gentoo.org>; Fri, 16 Apr 2021 03:39:23 +0000 (UTC)
Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id CBED3335CA3
	for <gentoo-commits@lists.gentoo.org>; Fri, 16 Apr 2021 03:39:21 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 31894643
	for <gentoo-commits@lists.gentoo.org>; Fri, 16 Apr 2021 03:39:20 +0000 (UTC)
From: "Mike Frysinger" <vapier@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" <vapier@gentoo.org>
Message-ID: <1618543423.ea2721570e1993b0f1ffc3a9b6b9d9aaa7ad22c9.vapier@gentoo>
Subject: [gentoo-commits] proj/pax-utils:master commit in: /
X-VCS-Repository: proj/pax-utils
X-VCS-Files: lddtree.py
X-VCS-Directories: /
X-VCS-Committer: vapier
X-VCS-Committer-Name: Mike Frysinger
X-VCS-Revision: ea2721570e1993b0f1ffc3a9b6b9d9aaa7ad22c9
X-VCS-Branch: master
Date: Fri, 16 Apr 2021 03:39:20 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 62a1902a-6d1c-495f-ae23-df6aae3898d5
X-Archives-Hash: 0876e6af0228419110ba818d1b9e3890

commit:     ea2721570e1993b0f1ffc3a9b6b9d9aaa7ad22c9
Author:     Mike Frysinger <vapier <AT> chromium <DOT> org>
AuthorDate: Fri Apr 16 03:23:43 2021 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri Apr 16 03:23:43 2021 +0000
URL:        https://gitweb.gentoo.org/proj/pax-utils.git/commit/?id=ea272157

lddtree: apply functools cache to some repeated filesystem calls

Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>

 lddtree.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lddtree.py b/lddtree.py
index e3dafda..7ec04fa 100755
--- a/lddtree.py
+++ b/lddtree.py
@@ -40,6 +40,7 @@ they need will be placed into /foo/lib/ only.
 """
 
 import argparse
+import functools
 import glob
 import errno
 import os
@@ -87,6 +88,7 @@ def normpath(path):
     return os.path.normpath(path).replace('//', '/')
 
 
+@functools.lru_cache(maxsize=None)
 def readlink(path, root, prefixed=False):
     """Like os.readlink(), but relative to a |root|
 
@@ -167,6 +169,7 @@ exec \
     os.chmod(wrappath, 0o0755)
 
 
+@functools.lru_cache(maxsize=None)
 def ParseLdPaths(str_ldpaths, root='', path=None):
     """Parse the colon-delimited list of paths and apply ldso rules to each