public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: "Michał Górny" <mgorny@gentoo.org>
Subject: [gentoo-dev] [PATCH 2/7] eclass/tests: Add pypi-bench.sh for global scope logic
Date: Tue, 13 Jun 2023 08:45:02 +0200	[thread overview]
Message-ID: <20230613064742.413335-3-mgorny@gentoo.org> (raw)
In-Reply-To: <20230613064742.413335-1-mgorny@gentoo.org>

The benchmark yield roughly 327 ops / s on my machine.

Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
 eclass/tests/pypi-bench.sh | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100755 eclass/tests/pypi-bench.sh

diff --git a/eclass/tests/pypi-bench.sh b/eclass/tests/pypi-bench.sh
new file mode 100755
index 000000000000..6c4696c19fcb
--- /dev/null
+++ b/eclass/tests/pypi-bench.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+# Copyright 2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+source tests-common.sh || exit
+
+PN=foo-bar
+PYPI_PN=Foo.Bar
+PV=1.2.3_beta2
+WORKDIR='<WORKDIR>'
+
+inherit pypi
+
+doit() {
+	for (( i = 0; i < 1000; i++ )); do
+		_pypi_set_globals
+	done
+}
+
+time doit
+
+texit
-- 
2.41.0



  parent reply	other threads:[~2023-06-13  6:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-13  6:45 [gentoo-dev] [PATCH 0/7] pypi.eclass: performance optimizations Michał Górny
2023-06-13  6:45 ` [gentoo-dev] [PATCH 1/7] pypi.eclass: Move setting globals to a function Michał Górny
2023-06-13  6:45 ` Michał Górny [this message]
2023-06-13  6:45 ` [gentoo-dev] [PATCH 3/7] pypi.eclass: Translate version once in the default scenario Michał Górny
2023-06-13  6:45 ` [gentoo-dev] [PATCH 4/7] pypi.eclass: Normalize names without subshell Michał Górny
2023-06-13  6:45 ` [gentoo-dev] [PATCH 5/7] pypi.eclass: Translate version without subshell in common case Michał Górny
2023-06-13  6:45 ` [gentoo-dev] [PATCH 6/7] pypi.eclass: Replace pypi_sdist_url in global scope Michał Górny
2023-06-13  6:45 ` [gentoo-dev] [PATCH 7/7] pypi.eclass: Avoid subshell for extglob setting Michał Górny
2023-06-13  9:07   ` Ulrich Mueller
2023-06-13 13:37     ` Michał Górny

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=20230613064742.413335-3-mgorny@gentoo.org \
    --to=mgorny@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.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