public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Zac Medico <zmedico@gentoo.org>
To: gentoo-portage-dev@lists.gentoo.org,
	Pin-yen Lin <treapking@chromium.org>
Subject: Re: [gentoo-portage-dev] [PATCH 2/2] Add caching to _slot_operator_check_reverse_dependencies
Date: Mon, 28 Nov 2022 07:47:25 -0800	[thread overview]
Message-ID: <7d39c5e2-c08f-f7e9-31a0-9c6979d31428@gentoo.org> (raw)
In-Reply-To: <20221125033627.1105638-2-treapking@chromium.org>

On 11/24/22 19:36, Pin-yen Lin wrote:
> Add lru_cache to speed up the running time of "Calculating
> dependencies".
> 
> In a ChromeOS use case, this patch decreases the running time from
> 311s to 197s with almost no memory usage increase.
> 
> Signed-off-by: Pin-yen Lin <treapking@chromium.org>
> ---
>   lib/_emerge/depgraph.py | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py
> index ce6cabcc1..9649bb2a8 100644
> --- a/lib/_emerge/depgraph.py
> +++ b/lib/_emerge/depgraph.py
> @@ -2240,6 +2240,7 @@ class depgraph:
>   
>           return None
>   
> +    @functools.lru_cache(maxsize=100)
>       def _slot_operator_check_reverse_dependencies(
>           self, existing_pkg, candidate_pkg, replacement_parent=None
>       ):

Merged. Thank you!

https://gitweb.gentoo.org/proj/portage.git/commit/?id=0c42cc962e1926ecbdc83d903a2804f9e037f2a9
https://gitweb.gentoo.org/proj/portage.git/commit/?id=839ab46be1777e5886da28b98b53a462b992c5bf
-- 
Thanks,
Zac



      parent reply	other threads:[~2022-11-28 15:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-25  3:36 [gentoo-portage-dev] [PATCH 1/2] Move and rename check_reverse_dependencies Pin-yen Lin
2022-11-25  3:36 ` [gentoo-portage-dev] [PATCH 2/2] Add caching to _slot_operator_check_reverse_dependencies Pin-yen Lin
2022-11-25 17:08   ` Matt Turner
2022-11-28 15:47   ` Zac Medico [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7d39c5e2-c08f-f7e9-31a0-9c6979d31428@gentoo.org \
    --to=zmedico@gentoo.org \
    --cc=gentoo-portage-dev@lists.gentoo.org \
    --cc=treapking@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox