GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||
GeezerVison is showing github.com — gh-107369: Optimise ``textwrap.indent()`` by AA-Turner · Pull Request #131923 · python/cpython Conversation
| ||||||||||||||
| Benchmark | textwrap | new |
|---|---|---|
| indent | 3.59 ms | 2.81 ms: 1.28x faster |
Benchmarked by indenting the contents of Objects/unicodeobject.c.
A
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This is funny because this was my very first attempt at CPython: https://github.com/python/cpython/pull/107426/files :') It was rejected at that time (#107426 (comment)) though
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Oh, I didn't see that PR! I think the optimisation is worth it, it's a small change and a reasonable speed-up for the default case ( A |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| @@ -0,0 +1,2 @@ | |||
| Improved performance of :func:`textwrap.dedent` by an average of ~1.3x. | |||
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
s/dedent/indent/
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.