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

Signed-off-by: Michał Górny <[email protected]>
---
 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


Reply via email to