Gentoo Archives: gentoo-dev

From: magic-gentoo@××××××××××××××.de
To: Zac Medico <zmedico@g.o>, gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] speeding up usage of portage in e-file / portage file list
Date: Sat, 23 May 2020 20:41:15
Message-Id: c92eb83b-6aa1-3da0-7aea-52e57d7d5065@devloop.de
In Reply to: Re: [gentoo-dev] speeding up usage of portage in e-file / portage file list by Zac Medico
1 Am 23.05.2020 um 22:20 schrieb Zac Medico:
2 > On 5/23/20 1:02 PM, magic-gentoo@××××××××××××××.de wrote:
3 >> I rewrote e-file in python by using the portage API [1]. But loading the
4 >> API slows down the whole script. Is there any way to speed up my
5 >> implementation? Have I done something fundamentally wrong?
6 >
7 > When I patched the portage API out of your script, I saw the run time
8 > drop from 4.2 seconds to 3.2 seconds with this patch:
9 > ...
10 >
11 > Are your results worse than mine?
12
13 Nope, but maybe the phrase "loading the API" was misleading. I'd like to
14 replace it with: "But using the API slows down the whole script.". This
15 means it is much slower to get the additional informations by portage
16 API than just grep'ing throught the ebuild files. If I run the python
17 e-file on my machine it takes 3.2 seconds for a single file. The bash
18 e-file show the same result within a second or so.
19
20 regards
21 Daniel

Replies