Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.2k
gh-107369: Optimisetextwrap.indent()
#131923
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
picnixz left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for 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
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 |
51e0f2b
intopython:mainUh oh!
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
s/dedent/indent/
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Uh oh!
There was an error while loading.Please reload this page.
Follow-up to#131919, I noticed there was opportunity for improvement here too, a ~30% speed-up.
Benchmarked by indenting the contents of
Objects/unicodeobject.c
.A