@@ -15,18 +15,18 @@ For our performance investigation, we'll also include a fourth approach that [us
1515To benchmark the approaches, we wrote a [ small benchmark application] [ benchmark-application ] using the [ ` timeit ` ] [ timeit ] library.
1616
1717```
18- all: 1.505466179997893e -05
19- all: 1.6063886400021147e -05 // with sentence.casefold()
20- set: 1.950172399985604e -06
21- len: 3.7158977999933994e -06
22- bit: 8.75982620002469e-06
18+ all: 1.8692991019000146e -05
19+ all: 1.686682232399926e -05 // with sentence.casefold()
20+ set: 2.5181135439997888e -06
21+ len: 5.848111433000668e -06
22+ bit: 1.2118699087000096e-05
2323```
2424
2525- The ` set ` ` len() ` approach is not as fast as the ` set ` ` issubset() ` approach.
26- - The ` all() ` approach is slower than either ` set ` approach.
27- Using ` casefold ` was slower than using ` lower ` .
26+ - The ` all() ` approach is significantly slower than either ` set ` approach (approximately 6-8x slower) .
27+ Using ` casefold() ` versus ` lower() ` showed variable performance, with each being faster in different runs .
2828- Although the bit field approach may be faster in other languages, it is significantly slower in Python.
29- It is faster than the ` all() ` approach, but much slower than either ` set ` approach.
29+ It is faster than the ` all() ` approach, but much slower than either ` set ` approach.
3030
3131[ benchmark-application ] : https://github.com/exercism/python/blob/main/exercises/practice/pangram/.articles/performance/code/Benchmark.py
3232[ timeit ] : https://docs.python.org/3/library/timeit.html
0 commit comments