Skip to content

Commit 98b3fb8

Browse files
authored
Benchmark (#8)
1 parent e748062 commit 98b3fb8

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

.github/workflows/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,7 @@ jobs:
5151
if: matrix.python-version == '3.10'
5252
with:
5353
flags: unittests
54+
- name: Benchmark
55+
run: |
56+
pip install pyperf
57+
./bench.sh

bench.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
set -eu
3+
TESTDIR=$(mktemp -d)
4+
python -m pyperf timeit -o "${TESTDIR}/uuid1.json" -s "import uuid" "uuid.uuid1()"
5+
python -m pyperf timeit -o "${TESTDIR}/uuid4.json" -s "import uuid" "uuid.uuid4()"
6+
python -m pyperf timeit -o "${TESTDIR}/uuid6.json" -s "import uuid6" "uuid6.uuid6()"
7+
python -m pyperf timeit -o "${TESTDIR}/uuid7.json" -s "import uuid6" "uuid6.uuid7()"
8+
python -m pyperf compare_to --table "${TESTDIR}/uuid1.json" "${TESTDIR}/uuid4.json" "${TESTDIR}/uuid6.json" "${TESTDIR}/uuid7.json"
9+
rm -rf -- "${TESTDIR}"

0 commit comments

Comments
 (0)