Skip to content

Commit

Permalink
Update content.md
Browse files Browse the repository at this point in the history
Fixed benchmark table and broken link in performance article.
  • Loading branch information
BethanyG committed Feb 28, 2024
1 parent 84a22c6 commit a756ba5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions exercises/practice/acronym/.articles/performance/content.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ Even though the `re.sub()` solution takes only 652 steps in the regex engine, `r



|| | **Len: 13** | **Len: 14** | **Len: 19** | **Len: 20** | **Len: 25** | **Len: 30** | **Len: 35** | **Len: 39** | **Len: 42** | **Len: 45** | **Len: 60** | **Len: 63** | **Len: 74** | **Len: 150** | **Len: 210** | **Len: 360** | **Len: 400** | **Len: 2940** |
| **String Length >>>** | **13** | **14** | **19** | **20** | **25** | **30** | **35** | **39** | **42** | **45** | **60** | **63** | **74** | **150** | **210** | **360** | **400** | **2940** |
|------------------------------ |:-----------: |:-----------: |:-----------: |:-----------: |:-----------: |:-----------: |:-----------: |:-----------: |:-----------: |:-----------: |:-----------: |:-----------: |:-----------: |:------------: |:------------: |:------------: |:------------: |:-------------: |
| **loop** | 5.79e-07 | 4.96e-07 | 6.98e-07 | 7.41e-07 | 6.18e-07 | 7.25e-07 | 1.03e-06 | 7.33e-07 | 1.16e-06 | 8.71e-07 | 1.51e-06 | 1.65e-06 | 1.83e-06 | 2.43e-06 | 4.63e-06 | 7.76e-06 | 4.85e-06 | 5.94e-05 |
| **list_comprehension** | 7.28e-07 | 6.57e-07 | 8.26e-07 | 8.62e-07 | 7.67e-07 | 8.30e-07 | 1.08e-06 | 8.68e-07 | 1.24e-06 | 4.00e-07 | 1.49e-06 | 1.55e-06 | 1.76e-06 | 2.19e-06 | 4.08e-06 | 7.21e-06 | 4.40e-06 | 5.42e-05 |
| **list comprehension** | 7.28e-07 | 6.57e-07 | 8.26e-07 | 8.62e-07 | 7.67e-07 | 8.30e-07 | 1.08e-06 | 8.68e-07 | 1.24e-06 | 4.00e-07 | 1.49e-06 | 1.55e-06 | 1.76e-06 | 2.19e-06 | 4.08e-06 | 7.21e-06 | 4.40e-06 | 5.42e-05 |
| **functools.reduce()** | 7.93e-07 | 6.65e-07 | 9.50e-07 | 2.43e-06 | 8.19e-07 | 9.56e-07 | 1.36e-06 | 4.12e-07 | 1.64e-06 | 1.21e-06 | 2.03e-06 | 2.14e-06 | 2.45e-06 | 3.15e-06 | 6.03e-06 | 1.03e-05 | 6.19e-06 | 8.10e-05 |
| **map() ** | 8.05e-07 | 7.21e-07 | 9.34e-07 | 9.46e-07 | 8.32e-07 | 9.16e-07 | 1.23e-06 | 9.52e-07 | 1.44e-06 | 1.14e-06 | 1.71e-06 | 1.80e-06 | 2.00e-06 | 2.58e-06 | 4.81e-06 | 8.02e-06 | 4.95e-06 | 5.64e-05 |
| **generator expression** | 8.85e-07 | 7.90e-07 | 1.01e-06 | 1.01e-06 | 9.26e-07 | 2.49e-06 | 1.30e-06 | 1.06e-06 | 1.49e-06 | 1.19e-06 | 1.81e-06 | 1.86e-06 | 2.10e-06 | 2.67e-06 | 5.12e-06 | 8.61e-06 | 5.12e-06 | 5.81e-05 |
| **map()** | 8.05e-07 | 7.21e-07 | 9.34e-07 | 9.46e-07 | 8.32e-07 | 9.16e-07 | 1.23e-06 | 9.52e-07 | 1.44e-06 | 1.14e-06 | 1.71e-06 | 1.80e-06 | 2.00e-06 | 2.58e-06 | 4.81e-06 | 8.02e-06 | 4.95e-06 | 5.64e-05 |
| **generator expression** | 8.85e-07 | 7.90e-07 | 1.01e-06 | 1.01e-06 | 9.26e-07 | 2.49e-06 | 1.30e-06 | 1.06e-06 | 1.49e-06 | 1.19e-06 | 1.81e-06 | 1.86e-06 | 2.10e-06 | 2.67e-06 | 5.12e-06 | 8.61e-06 | 5.12e-06 | 5.81e-05 |
| **re.finditer()** | 1.05e-06 | 1.74e-06 | 2.44e-06 | 2.40e-06 | 2.09e-06 | 2.45e-06 | 3.28e-06 | 2.42e-06 | 8.15e-06 | 3.12e-06 | 5.15e-06 | 5.18e-06 | 5.94e-06 | 7.89e-06 | 1.46e-05 | 2.35e-05 | 1.48e-05 | 1.68e-04 |
| **regex with str.join()** | 1.62e-06 | 1.42e-06 | 1.85e-06 | 1.91e-06 | 1.66e-06 | 1.88e-06 | 2.61e-06 | 4.41e-06 | 3.14e-06 | 2.47e-06 | 3.92e-06 | 4.11e-06 | 4.61e-06 | 6.24e-06 | 1.13e-05 | 1.86e-05 | 1.19e-05 | 1.36e-04 |
| **re.findall() 1st letters** | 1.63e-06 | 1.57e-06 | 2.04e-06 | 2.12e-06 | 2.16e-06 | 2.50e-06 | 3.18e-06 | 2.90e-06 | 3.73e-06 | 3.41e-06 | 4.84e-06 | 5.22e-06 | 5.94e-06 | 1.00e-05 | 1.54e-05 | 2.48e-05 | 2.28e-05 | 1.95e-04 |
Expand All @@ -57,9 +57,9 @@ Keep in mind that all these approaches are very fast, and that benchmarking at t
Measurements were taken on a 3.1 GHz Quad-Core Intel Core i7 Mac running MacOS Ventura.
Tests used `timeit.Timer.autorange()`, repeated 3 times.
Time is reported in seconds taken per string after calculating the 'best of' time.
The timeit module docs have more details, and [note.nkmk.me][note_nkmk_me] has a nice summary of methods.

The [timeit module][timeit] docs have more details, and [note.nkmk.me][note_nkmk_me] has a nice summary of methods.

[approaches]: https://exercism.org/tracks/python/exercises/acronym/dig_deeper
[approach-functools-reduce]: https://exercism.org/tracks/python/exercises/acronym/approaches/functools-reduce
[approach-generator-expression]: https://exercism.org/tracks/python/exercises/acronym/approaches/generator-expression
[approach-list-comprehension]: https://exercism.org/tracks/python/exercises/acronym/approaches/list-comprehension
Expand Down

0 comments on commit a756ba5

Please sign in to comment.