@@ -93,32 +93,34 @@ This implementation does not include a clock sequence counter as defined in the
9393
9494## Performance
9595
96+ Run the included shell script ` ./bench.sh ` to test on your own machine.
97+
9698MacBook Air
9799```
98- Python 3.9.7 (default, Oct 12 2021, 22:38:23)
99- [Clang 13.0.0 (clang-1300.0.29.3)] on darwin
100- Type "help", "copyright", "credits" or "license" for more information.
101- >>> import timeit
102- >>> timeit.timeit('uuid1()', number=100000, setup="from uuid import uuid1")
103- 0.14462158300011652
104- >>> timeit.timeit('uuid6()', number=100000, setup="from uuid6 import uuid6")
105- 0.2687861250000019
106- >>> timeit.timeit('uuid7()', number=100000, setup="from uuid6 import uuid7")
107- 0.22819437500000106
100+ Python 3.10.2
101+ Mean +- std dev: 1.02 us +- 0.01 us
102+ Mean +- std dev: 1.11 us +- 0.01 us
103+ Mean +- std dev: 2.34 us +- 0.02 us
104+ Mean +- std dev: 2.04 us +- 0.02 us
105+ +-----------+---------+-----------------------+-----------------------+-----------------------+
106+ | Benchmark | uuid1 | uuid4 | uuid6 | uuid7 |
107+ +===========+=========+=======================+=======================+=======================+
108+ | timeit | 1.02 us | 1.11 us: 1.08x slower | 2.34 us: 2.28x slower | 2.04 us: 1.99x slower |
109+ +-----------+---------+-----------------------+-----------------------+-----------------------+
108110```
109111
110112Google [ Cloud Shell] [ cloud shell ] VM
111113```
112- Python 3.7.3 (default, Jan 22 2021, 20:04:44)
113- [GCC 8.3.0] on linux
114- Type "help", "copyright", "credits" or "license" for more information.
115- >>> import timeit
116- >>> timeit.timeit('uuid1()', number=100000, setup="from uuid import uuid1")
117- 1.2075679750000745
118- >>> timeit.timeit('uuid6()', number=100000, setup="from uuid6 import uuid6")
119- 0.6328954440000416
120- >>> timeit.timeit('uuid7()', number=100000, setup="from uuid6 import uuid7")
121- 0.4709622599998511
114+ Python 3.7.3
115+ Mean +- std dev: 10.1 us +- 0.7 us
116+ Mean +- std dev: 4.25 us +- 0.79 us
117+ Mean +- std dev: 9.37 us +- 1.75 us
118+ Mean +- std dev: 7.51 us +- 1.42 us
119+ +-----------+---------+-----------------------+-----------------------+-----------------------+
120+ | Benchmark | uuid1 | uuid4 | uuid6 | uuid7 |
121+ +===========+=========+=======================+=======================+=======================+
122+ | timeit | 10.1 us | 4.25 us: 2.38x faster | 9.37 us: 1.08x faster | 7.51 us: 1.35x faster |
123+ +-----------+---------+-----------------------+-----------------------+-----------------------+
122124```
123125
124126[ ietf draft ] : https://github.com/uuid6/uuid6-ietf-draft
0 commit comments