Skip to content

Commit 9908c37

Browse files
committed
chore: docs and benchmarks
1 parent e1047f6 commit 9908c37

File tree

6 files changed

+35
-40
lines changed

6 files changed

+35
-40
lines changed

benchmarks/README.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

benchmarks/bench_generator.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,65 +3,66 @@
33
import uuid_utils
44

55
node = uuid.getnode()
6+
iterations = 10_000
67

78

89
def uuid_uuid1() -> None:
9-
for _ in range(10_000):
10+
for _ in range(iterations):
1011
uuid.uuid1(node)
1112

1213

1314
def uuid_utils_uuid1() -> None:
14-
for _ in range(10_000):
15+
for _ in range(iterations):
1516
uuid_utils.uuid1(node)
1617

1718

1819
def uuid_uuid3() -> None:
19-
for _ in range(10_000):
20+
for _ in range(iterations):
2021
uuid.uuid3(namespace=uuid.NAMESPACE_DNS, name="python.org")
2122

2223

2324
def uuid_utils_uuid3() -> None:
24-
for _ in range(10_000):
25+
for _ in range(iterations):
2526
uuid_utils.uuid3(namespace=uuid_utils.NAMESPACE_DNS, name="python.org")
2627

2728

2829
def uuid_uuid4() -> None:
29-
for _ in range(10_000):
30+
for _ in range(iterations):
3031
uuid.uuid4()
3132

3233

3334
def uuid_utils_uuid4() -> None:
34-
for _ in range(10_000):
35+
for _ in range(iterations):
3536
uuid_utils.uuid4()
3637

3738

3839
def uuid_uuid5() -> None:
39-
for _ in range(10_000):
40+
for _ in range(iterations):
4041
uuid.uuid5(namespace=uuid.NAMESPACE_DNS, name="python.org")
4142

4243

4344
def uuid_utils_uuid5() -> None:
44-
for _ in range(10_000):
45+
for _ in range(iterations):
4546
uuid_utils.uuid5(namespace=uuid_utils.NAMESPACE_DNS, name="python.org")
4647

4748

4849
def uuid_uuid6() -> None:
49-
for _ in range(10_000):
50+
for _ in range(iterations):
5051
uuid.uuid6()
5152

5253

5354
def uuid_utils_uuid6() -> None:
54-
for _ in range(10_000):
55+
for _ in range(iterations):
5556
uuid_utils.uuid6()
5657

5758

5859
def uuid_uuid7() -> None:
59-
for _ in range(10_000):
60+
for _ in range(iterations):
6061
uuid.uuid7()
6162

6263

6364
def uuid_utils_uuid7() -> None:
64-
for _ in range(10_000):
65+
for _ in range(iterations):
6566
uuid_utils.uuid7()
6667

6768

benchmarks/bench_parser.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,44 +2,46 @@
22

33
import uuid_utils
44

5+
ITERATIONS = 10_000
6+
57

68
def uuid_from_hex() -> None:
7-
for _ in range(10_000):
9+
for _ in range(ITERATIONS):
810
uuid.UUID("a8098c1a-f86e-11da-bd1a-00112444be1e")
911

1012

1113
def uuid_utils_from_hex() -> None:
12-
for _ in range(10_000):
14+
for _ in range(ITERATIONS):
1315
uuid_utils.UUID("a8098c1a-f86e-11da-bd1a-00112444be1e")
1416

1517

1618
def uuid_from_bytes() -> None:
17-
for _ in range(10_000):
19+
for _ in range(ITERATIONS):
1820
uuid.UUID("a8098c1a-f86e-11da-bd1a-00112444be1e")
1921

2022

2123
def uuid_utils_from_bytes() -> None:
22-
for _ in range(10_000):
24+
for _ in range(ITERATIONS):
2325
uuid_utils.UUID("a8098c1a-f86e-11da-bd1a-00112444be1e")
2426

2527

2628
def uuid_from_int() -> None:
27-
for _ in range(10_000):
29+
for _ in range(ITERATIONS):
2830
uuid.UUID("a8098c1a-f86e-11da-bd1a-00112444be1e")
2931

3032

3133
def uuid_utils_from_int() -> None:
32-
for _ in range(10_000):
34+
for _ in range(ITERATIONS):
3335
uuid_utils.UUID("a8098c1a-f86e-11da-bd1a-00112444be1e")
3436

3537

3638
def uuid_from_fields() -> None:
37-
for _ in range(10_000):
39+
for _ in range(ITERATIONS):
3840
uuid.UUID(fields=(2819197978, 63598, 4570, 189, 26, 73622928926))
3941

4042

4143
def uuid_utils_from_fields() -> None:
42-
for _ in range(10_000):
44+
for _ in range(ITERATIONS):
4345
uuid_utils.UUID(fields=(2819197978, 63598, 4570, 189, 26, 73622928926))
4446

4547

docs/index.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@
22

33
<div align="center">
44

5-
[![Package version](https://badge.fury.io/py/uuid-utils.svg)](https://pypi.org/project/uuid-utils/)
6-
[![Supported Python versions](https://img.shields.io/pypi/pyversions/uuid-utils.svg?color=%2334D058)](https://pypi.org/project/uuid-utils)
7-
[![CodSpeed](https://img.shields.io/endpoint?url=https://codspeed.io/badge.json)](https://codspeed.io/aminalaee/uuid-utils?utm_source=badge)
5+
<a href="https://pypi.org/project/uuid-utils/" target="_blank">>
6+
<img src="https://badge.fury.io/py/uuid-utils.svg" alt="Package version">
7+
</a>
8+
<a href="https://pypi.org/project/uuid-utils" target="_blank">
9+
<img src="https://img.shields.io/pypi/pyversions/uuid-utils.svg?color=%2334D058" alt="Supported Python versions">
10+
</a>
11+
<a href="https://codspeed.io/aminalaee/uuid-utils?utm_source=badge" target="_blank">
12+
<img src="https://img.shields.io/endpoint?url=https://codspeed.io/badge.json" alt="Codspeed">
13+
</a>
814

915
</div>
1016

mkdocs.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
site_name: UUID-Utils
2-
site_description: Python bindings to Rust UUID
2+
site_description: Fast, drop-in replacement for Python's uuid module, powered by Rust.
33
site_url: https://aminalaee.github.io/uuid-utils
44

55
theme:
@@ -39,7 +39,5 @@ extra:
3939
social:
4040
- icon: fontawesome/brands/github
4141
link: https://github.com/aminalaee
42-
- icon: fontawesome/brands/twitter
43-
link: https://twitter.com/aminalaee
4442
- icon: fontawesome/brands/linkedin
45-
link: https://www.linkedin.com/in/amin-alaee
43+
link: https://www.linkedin.com/in/amin-alaee

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ mypy==1.19.0
44
pytest==9.0.1
55
pytest-codspeed==4.2.0
66
ruff==0.14.7
7+
richbench==1.0.3

0 commit comments

Comments
 (0)