-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added starter content to performance to clear CI check.
- Loading branch information
Showing
2 changed files
with
48 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Performance | ||
|
||
In this approach, we'll find out how to most efficiently form an acronym from an input string. | ||
|
||
The [approaches page][approaches] lists seven idiomatic approaches to this exercise: | ||
|
||
1. [Using a `list-comprehension`][approach-list-comprehension] | ||
2. [Using a `loop`][approach-loop] | ||
3. [Using `functools.reduce()`][approach-functools-reduce] | ||
4. [Using `map()`][approach-map-function] | ||
5. [Using a `generator-expression`][approach-generator-expression] | ||
6. [Using a `regex` with `str.join()`][approach-regex-join] | ||
7. [Using `re.sub()`][approach-regex-sub] | ||
|
||
|
||
## Benchmarks | ||
|
||
To benchmark these approaches, we wrote a [small benchmark application][benchmark-application] using []. | ||
The benchmark checks the various approaches against | ||
Besides the regular CPU-time columns, the amount of memory used was also tracked. | ||
|
||
These are the results: | ||
|
||
[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 | ||
[approach-loop]: https://exercism.org/tracks/python/exercises/acronym/approaches/loop | ||
[approach-map-function]: https://exercism.org/tracks/python/exercises/acronym/approaches/map-function | ||
[approach-regex-join]: https://exercism.org/tracks/python/exercises/acronym/approaches/regex-join | ||
[approach-regex-sub]: https://exercism.org/tracks/python/exercises/acronym/approaches/regex-sub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters