Gentoo Archives: gentoo-portage-dev

From: Sebastian Luther <SebastianLuther@×××.de>
To: gentoo-portage-dev@l.g.o
Subject: [gentoo-portage-dev] Avoid repeated failing os.access
Date: Tue, 18 Feb 2014 21:02:30
Message-Id: 1392757337-26882-1-git-send-email-SebastianLuther@gmx.de
1 Hi all,
2
3 people have several times complained about useless access calls in
4 strace logs. The problem is that a successful call in
5 portdbapi.findname2 is cached by aux_get, but a failed is not.
6
7 This patch works around this by adding a cache for findname2.
8 This gives a speed up of about 5% compared to current master.
9
10 The real problem is that the resolver calls aux_get for a given
11 cpv for each existing repo. That's because portdbapi.cp_list returns
12 only cpvs without telling the caller to which repo it belongs.
13 Fixing that properly would require quite some work on the portdbapi
14 class.
15
16 There was the complaint that instead of writing the caching myself
17 I should be using a memoization decorator. Unfortunately nobody could
18 suggest a good implementation with proper license to use. If someone
19 knows one, let me know.
20
21 - Sebastian

Replies

Subject Author
[gentoo-portage-dev] [PATCH] portdbapi: Add cache to avoid repeated failing os.access calls Sebastian Luther <SebastianLuther@×××.de>