Uh oh!
There was an error while loading. Please reload this page.
gh-91524: Speed up the regular expression substitution - #91525
Conversation
Functions re.sub() and re.subn() and corresponding re.Pattern methods are now 2-3 times faster for replacement strings containing group references.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
bedevere-bot
commented
Apr 14, 2022
When you're done making the requested changes, leave the comment: |
ghost
commented
Apr 15, 2022
If use There are two data contracts that crossing functions:
Such data contracts increase the difficulty of code maintenance. If use typedefstruct {
PyObject_VAR_HEADstruct {
inttype; // literal or groupPyObject*item;
} items[0];
} TemplateObject;In the current PR, adjacent groups also waste space. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…thon into re-compile-template
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
serhiy-storchaka
commented
Apr 15, 2022
I do not think so. The benefit of I may try to experiment with |
serhiy-storchaka
commented
Apr 15, 2022
Thank you for review. The conditions of my sight make my to easily miss some details. I have made the requested changes; please review again. |
bedevere-bot
commented
Apr 15, 2022
Thanks for making the requested changes! @gpshead: please review the changes made to this pull request. |
Uh oh!
There was an error while loading. Please reload this page.
serhiy-storchaka
commented
Apr 15, 2022
Please do not do this. Your help compensates my disadvantage. |
gpshead
commented
Apr 16, 2022
@animalize - While it is great you are concerned for others health, it comes across poorly to say things in an "ultimatum" style such as a "threat" to stop working with someone because they've implied they may have a health concern. This is not kind. In many cultures (including Python's) that conduct is seen as discrimination. It limits others opportunities based on your own presumption of their abilities. Among committers (which @serhiy-storchaka is a long time member of) none of us expect the steering council to micromanage our lives and most of us would rightfully reject that concept if we were to try. That isn't our purpose. While asking me or the SC to treat another committer specially was presumably voiced out of genuine concern here, it can come across as a put down that belittles their work even if this is not what you intended. We trust everyone to understand their own contribution abilities and act accordingly as they see fit. Code review collaboration is a way for all of us to fill in gaps in that we all have in our work. Nobody is perfect. (I'm replying with the above in this forum so that this response is visible to the same audience as the earlier messages that led to it.) Lets ultimately stay focused on the PR here. Thanks for your reviews! |
Sorry. I don't know what to say. I tried to improve this PR locally, IMHO the data contracts and the |
ghost
commented
Apr 19, 2022
I'll send a PR to serhiy-storchaka:re-compile-template later. |
eendebakpt
commented
Oct 23, 2022
@serhiy-storchaka This PR has been approved by one other core dev, but not merged for some reason. The performance improvement seems worthwhile. Is there a reason why the branch has not been updated? If needed I can help to update the branch to current main |
gpshead
commented
Oct 23, 2022
Thanks Serhiy & reviewers! |
serhiy-storchaka
commented
Oct 24, 2022
Thank you Gregory for the final polishing. |
Functions re.sub() and re.subn() and corresponding re.Pattern methods
are now 2-3 times faster for replacement strings containing group references.
Closes#91524