MINOR: Use statically compiled regular expressions instead of inline#5042
MINOR: Use statically compiled regular expressions instead of inline#5042KoenDG wants to merge 4 commits intoapache:trunkfrom KoenDG:staticpattern2
Conversation
…. This should improve performance, as in-place means that the regex has to be compiled again each time the code path is traversed. Which is not perfomant.
|
Pinging @guozhangwang Can you assign someone to look at this? Sorry to bother you, just saw you assigning someone in this PR: #4745 Also, the builds seem to be gone so I can't check code coverage for these changes. Though the resulting functionality should be identical. |
|
cc @ijuma for reviews. |
|
Thanks for the PR. The file |
|
@ijuma Is it better if I rebase it, or just make a new PR on a new branch? So that it's 1 commit. EDIT: Well, rebased it once I got home. Let me know if something else is needed. EDIT2: Well hot damn, another conflict. I'll get to fixing it later. |
Base64 file removed, as in trunk.
Merge conflict fixed, adapted changes as per changed seen in trunk.
|
Third time's the charm, let's hope. |
Merge conflict fixed.
|
Closing to make a new one. Too many rebases and merges with trunk. I prefer there to be just 1 commit if at all possible. |
This should improve performance, as in-place means that the regex has to be compiled again each time the code path is traversed. Which is not performant.
A nice writeup on this topic can be found here: https://softwareengineering.stackexchange.com/questions/216320/java-regex-patterns-compile-time-constants-or-instance-members
And it's also recommended in Joshua Bloch's "Effective Java 3rd Edition" (Item 6: Avoid creating unnecessary objects)
Committer Checklist (excluded from commit message)