-
-
Notifications
You must be signed in to change notification settings - Fork 31k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-103285: Rewrite _splitlines_no_ff to improve performance #103307
gh-103285: Rewrite _splitlines_no_ff to improve performance #103307
Conversation
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.
Thank you!
Misc/NEWS.d/next/Library/2023-04-06-04-35-59.gh-issue-103285.rCZ9-G.rst
Outdated
Show resolved
Hide resolved
@isidentical hi could you take a look at the change when you have some time? Thanks! |
This was something I complained a lot in the past, thanks for taking a stab at it. |
No problem :) Let me know if you need me to change anything. |
…CZ9-G.rst Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* Docstring * Check explicitly for maxline * \n\r preserve
6e7e73a
to
14a73a5
Compare
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.
Looks great, tested a bunch of scenarios involving consecutive \r
s etc. and seems to imitate the behavior of the old implementation exactly. With the additional tests, this should be good to go!
Do we need the approval from @sobolevn for auto merge to take effect? |
Oh, it seems like |
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.
Thank you, this looks great!
See comment and benchmark in #103285
ast.get_source_segment
is slower than it needs to be because it reads every line of the source. #103285