summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-05-15 09:33:54 +0000
committerCoprDistGit <infra@openeuler.org>2023-05-15 09:33:54 +0000
commit094ad498e746aee34f3a5a461ae8c880ecd169af (patch)
tree7f706ecfd123fb6134b257c34488244a5a37d497
parentc6e62bed56ee212cc1622ee7cfe8851458d20c25 (diff)
automatic import of python-benchmarker
-rw-r--r--.gitignore1
-rw-r--r--python-benchmarker.spec252
-rw-r--r--sources1
3 files changed, 254 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..46f6a69 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/Benchmarker-4.0.1.tar.gz
diff --git a/python-benchmarker.spec b/python-benchmarker.spec
new file mode 100644
index 0000000..160148d
--- /dev/null
+++ b/python-benchmarker.spec
@@ -0,0 +1,252 @@
+%global _empty_manifest_terminate_build 0
+Name: python-Benchmarker
+Version: 4.0.1
+Release: 1
+Summary: small but awesome utility for benchmarking
+License: Public Domain
+URL: https://pythonhosted.org/Benchmarker/
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/bb/59/a14359313e20efaaa367c60a87165f40ef9d3f5da2230a815db2433e3967/Benchmarker-4.0.1.tar.gz
+BuildArch: noarch
+
+
+%description
+Benchmarker.py is an awesome utility for benchmarking.
+
+ Document: https://pythonhosted.org/Benchmarker/
+
+ Example code (example.py)::
+
+ from benchmarker import Benchmarker
+
+ ## specify number of loop
+ with Benchmarker(1000*1000, width=20) as bench:
+ s1, s2, s3, s4, s5 = "Haruhi", "Mikuru", "Yuki", "Itsuki", "Kyon"
+
+ @bench(None) ## empty loop
+ def _(bm):
+ for i in bm:
+ pass
+
+ @bench("join")
+ def _(bm):
+ for i in bm:
+ sos = ''.join((s1, s2, s3, s4, s5))
+
+ @bench("concat")
+ def _(bm):
+ for i in bm:
+ sos = s1 + s2 + s3 + s4 + s5
+
+ @bench("format")
+ def _(bm):
+ for i in bm:
+ sos = '%s%s%s%s%s' % (s1, s2, s3, s4, s5)
+
+ Output Example::
+
+ $ python example.py -h # show help
+ $ python example.py -o result.json
+ ## benchmarker: release 4.0.0 (for python)
+ ## python version: 3.4.2
+ ## python compiler: GCC 4.8.2
+ ## python platform: Linux-3.13.0-36-generic-x86_64-with-debian-jessie-sid
+ ## python executable: /opt/vs/python/3.4.2/bin/python
+ ## cpu model: Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz # 2494.050 MHz
+ ## parameters: loop=1000000, cycle=1, extra=0
+
+ ## real (total = user + sys)
+ (Empty) 0.0236 0.0200 0.0200 0.0000
+ join 0.2779 0.2800 0.2800 0.0000
+ concat 0.3792 0.3800 0.3800 0.0000
+ format 0.4233 0.4300 0.4300 0.0000
+
+ ## Ranking real
+ join 0.2779 (100.0) ********************
+ concat 0.3792 ( 73.3) ***************
+ format 0.4233 ( 65.6) *************
+
+ ## Matrix real [01] [02] [03]
+ [01] join 0.2779 100.0 136.5 152.3
+ [02] concat 0.3792 73.3 100.0 111.6
+ [03] format 0.4233 65.6 89.6 100.0
+
+ See https://pythonhosted.org/Benchmarker/ for details.
+
+%package -n python3-Benchmarker
+Summary: small but awesome utility for benchmarking
+Provides: python-Benchmarker
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-Benchmarker
+Benchmarker.py is an awesome utility for benchmarking.
+
+ Document: https://pythonhosted.org/Benchmarker/
+
+ Example code (example.py)::
+
+ from benchmarker import Benchmarker
+
+ ## specify number of loop
+ with Benchmarker(1000*1000, width=20) as bench:
+ s1, s2, s3, s4, s5 = "Haruhi", "Mikuru", "Yuki", "Itsuki", "Kyon"
+
+ @bench(None) ## empty loop
+ def _(bm):
+ for i in bm:
+ pass
+
+ @bench("join")
+ def _(bm):
+ for i in bm:
+ sos = ''.join((s1, s2, s3, s4, s5))
+
+ @bench("concat")
+ def _(bm):
+ for i in bm:
+ sos = s1 + s2 + s3 + s4 + s5
+
+ @bench("format")
+ def _(bm):
+ for i in bm:
+ sos = '%s%s%s%s%s' % (s1, s2, s3, s4, s5)
+
+ Output Example::
+
+ $ python example.py -h # show help
+ $ python example.py -o result.json
+ ## benchmarker: release 4.0.0 (for python)
+ ## python version: 3.4.2
+ ## python compiler: GCC 4.8.2
+ ## python platform: Linux-3.13.0-36-generic-x86_64-with-debian-jessie-sid
+ ## python executable: /opt/vs/python/3.4.2/bin/python
+ ## cpu model: Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz # 2494.050 MHz
+ ## parameters: loop=1000000, cycle=1, extra=0
+
+ ## real (total = user + sys)
+ (Empty) 0.0236 0.0200 0.0200 0.0000
+ join 0.2779 0.2800 0.2800 0.0000
+ concat 0.3792 0.3800 0.3800 0.0000
+ format 0.4233 0.4300 0.4300 0.0000
+
+ ## Ranking real
+ join 0.2779 (100.0) ********************
+ concat 0.3792 ( 73.3) ***************
+ format 0.4233 ( 65.6) *************
+
+ ## Matrix real [01] [02] [03]
+ [01] join 0.2779 100.0 136.5 152.3
+ [02] concat 0.3792 73.3 100.0 111.6
+ [03] format 0.4233 65.6 89.6 100.0
+
+ See https://pythonhosted.org/Benchmarker/ for details.
+
+%package help
+Summary: Development documents and examples for Benchmarker
+Provides: python3-Benchmarker-doc
+%description help
+Benchmarker.py is an awesome utility for benchmarking.
+
+ Document: https://pythonhosted.org/Benchmarker/
+
+ Example code (example.py)::
+
+ from benchmarker import Benchmarker
+
+ ## specify number of loop
+ with Benchmarker(1000*1000, width=20) as bench:
+ s1, s2, s3, s4, s5 = "Haruhi", "Mikuru", "Yuki", "Itsuki", "Kyon"
+
+ @bench(None) ## empty loop
+ def _(bm):
+ for i in bm:
+ pass
+
+ @bench("join")
+ def _(bm):
+ for i in bm:
+ sos = ''.join((s1, s2, s3, s4, s5))
+
+ @bench("concat")
+ def _(bm):
+ for i in bm:
+ sos = s1 + s2 + s3 + s4 + s5
+
+ @bench("format")
+ def _(bm):
+ for i in bm:
+ sos = '%s%s%s%s%s' % (s1, s2, s3, s4, s5)
+
+ Output Example::
+
+ $ python example.py -h # show help
+ $ python example.py -o result.json
+ ## benchmarker: release 4.0.0 (for python)
+ ## python version: 3.4.2
+ ## python compiler: GCC 4.8.2
+ ## python platform: Linux-3.13.0-36-generic-x86_64-with-debian-jessie-sid
+ ## python executable: /opt/vs/python/3.4.2/bin/python
+ ## cpu model: Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz # 2494.050 MHz
+ ## parameters: loop=1000000, cycle=1, extra=0
+
+ ## real (total = user + sys)
+ (Empty) 0.0236 0.0200 0.0200 0.0000
+ join 0.2779 0.2800 0.2800 0.0000
+ concat 0.3792 0.3800 0.3800 0.0000
+ format 0.4233 0.4300 0.4300 0.0000
+
+ ## Ranking real
+ join 0.2779 (100.0) ********************
+ concat 0.3792 ( 73.3) ***************
+ format 0.4233 ( 65.6) *************
+
+ ## Matrix real [01] [02] [03]
+ [01] join 0.2779 100.0 136.5 152.3
+ [02] concat 0.3792 73.3 100.0 111.6
+ [03] format 0.4233 65.6 89.6 100.0
+
+ See https://pythonhosted.org/Benchmarker/ for details.
+
+%prep
+%autosetup -n Benchmarker-4.0.1
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-Benchmarker -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Mon May 15 2023 Python_Bot <Python_Bot@openeuler.org> - 4.0.1-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..5dc552d
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+6bcdf750fef4324bd0e51f53e67b9a4e Benchmarker-4.0.1.tar.gz