You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "tbw777 (via GitHub)" <gi...@apache.org> on 2023/02/06 16:50:55 UTC

[GitHub] [maven] tbw777 opened a new pull request, #984: Speedup by removing non pattern replaceAll with constant arg

tbw777 opened a new pull request, #984:
URL: https://github.com/apache/maven/pull/984

   replaceAll("ABC", "") is non Pattern method and therefore must be replaced to simple fast replace()
   A proofs of changes: https://gist.github.com/tbw777/21ee7301f284d5856e069c892b9051e2
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven] yeikel commented on pull request #984: Speedup by removing non pattern replaceAll with constant arg

Posted by "yeikel (via GitHub)" <gi...@apache.org>.
yeikel commented on PR #984:
URL: https://github.com/apache/maven/pull/984#issuecomment-1420975453

   This PR looks quite big. Is it just behind `master`?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven] gnodet commented on a diff in pull request #984: Speedup by removing non pattern replaceAll with constant arg

Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on code in PR #984:
URL: https://github.com/apache/maven/pull/984#discussion_r1098780600


##########
doap_Maven.rdf:
##########
@@ -1,426 +0,0 @@
-<!--

Review Comment:
   This should definitely not be removed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven] michael-o commented on a diff in pull request #984: Speedup by removing non pattern replaceAll with constant arg

Posted by "michael-o (via GitHub)" <gi...@apache.org>.
michael-o commented on code in PR #984:
URL: https://github.com/apache/maven/pull/984#discussion_r1099128946


##########
maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java:
##########
@@ -175,6 +175,8 @@ public class MavenCli {
 
     private CLIManager cliManager;
 
+    private static final Pattern NEXT_LINE = Pattern.compile("(\r\n)|(\r)|(\n)");

Review Comment:
   OS 9 is dead for 20+ years.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven] michael-o commented on pull request #984: Speedup by removing non pattern replaceAll with constant arg

Posted by "michael-o (via GitHub)" <gi...@apache.org>.
michael-o commented on PR #984:
URL: https://github.com/apache/maven/pull/984#issuecomment-1421399973

   Let me test this now...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven] gnodet commented on a diff in pull request #984: Speedup by removing non pattern replaceAll with constant arg

Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on code in PR #984:
URL: https://github.com/apache/maven/pull/984#discussion_r1098828047


##########
doap_Maven.rdf:
##########
@@ -66,6 +66,17 @@ under the License.
     <release>
       <Version>
         <name>Latest stable release</name>
+        <created>2023-01-31</created>

Review Comment:
   There should not be any doap file modification in this PR.  Bad merge ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven] michael-o commented on a diff in pull request #984: Speedup by removing non pattern replaceAll with constant arg

Posted by "michael-o (via GitHub)" <gi...@apache.org>.
michael-o commented on code in PR #984:
URL: https://github.com/apache/maven/pull/984#discussion_r1099101256


##########
maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java:
##########
@@ -175,6 +175,8 @@ public class MavenCli {
 
     private CLIManager cliManager;
 
+    private static final Pattern NEXT_LINE = Pattern.compile("(\r\n)|(\r)|(\n)");

Review Comment:
   The capturing groups are redudant and we likely don't care about Mac classic LS. `\r?\n` is more than enough.



##########
maven-model-builder/src/main/java/org/apache/maven/model/profile/activation/JdkVersionProfileActivator.java:
##########
@@ -43,6 +44,10 @@
 @Singleton
 public class JdkVersionProfileActivator implements ProfileActivator {
 
+    private static final Pattern FILTER_1 = Pattern.compile("[^0-9\\.\\-\\_]");
+    private static final Pattern FILTER_2 = Pattern.compile("[\\.\\-\\_]");

Review Comment:
   I bet the underscore does not require any escaping.



##########
maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java:
##########
@@ -49,6 +50,8 @@ public class PluginDescriptor extends ComponentSetDescriptor implements Cloneabl
 
     private static final String LIFECYCLE_DESCRIPTOR = "META-INF/maven/lifecycle.xml";
 
+    private static final Pattern PATTERN_FILTER_1 = Pattern.compile("(-?maven-?)|(-?plugin-?)");

Review Comment:
   Why so complex? `-?(maven|plugin)-?`, no?



##########
maven-settings-builder/src/main/java/org/apache/maven/settings/validation/DefaultSettingsValidator.java:
##########
@@ -42,11 +43,10 @@
 @Singleton
 public class DefaultSettingsValidator implements SettingsValidator {
 
-    private static final String ID_REGEX = "[A-Za-z0-9_\\-.]+";
+    private static final String ID = "[A-Za-z0-9_\\-.]+";

Review Comment:
   Here, the dot isn't escaped, a few classes it wasn't. As far as I remember the dot has no special meeting in ranges.



##########
maven-settings-builder/src/main/java/org/apache/maven/settings/validation/DefaultSettingsValidator.java:
##########
@@ -42,11 +43,10 @@
 @Singleton
 public class DefaultSettingsValidator implements SettingsValidator {
 
-    private static final String ID_REGEX = "[A-Za-z0-9_\\-.]+";
+    private static final String ID = "[A-Za-z0-9_\\-.]+";

Review Comment:
   You can simplify with `\w`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven] tbw777 commented on a diff in pull request #984: Speedup by removing non pattern replaceAll with constant arg

Posted by "tbw777 (via GitHub)" <gi...@apache.org>.
tbw777 commented on code in PR #984:
URL: https://github.com/apache/maven/pull/984#discussion_r1099144304


##########
maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java:
##########
@@ -49,6 +50,8 @@ public class PluginDescriptor extends ComponentSetDescriptor implements Cloneabl
 
     private static final String LIFECYCLE_DESCRIPTOR = "META-INF/maven/lifecycle.xml";
 
+    private static final Pattern PATTERN_FILTER_1 = Pattern.compile("(-?maven-?)|(-?plugin-?)");

Review Comment:
   -?(mave|plugi)n-?
   ))



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven] michael-o commented on a diff in pull request #984: Speedup by removing non pattern replaceAll with constant arg

Posted by "michael-o (via GitHub)" <gi...@apache.org>.
michael-o commented on code in PR #984:
URL: https://github.com/apache/maven/pull/984#discussion_r1099129393


##########
maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java:
##########
@@ -49,6 +50,8 @@ public class PluginDescriptor extends ComponentSetDescriptor implements Cloneabl
 
     private static final String LIFECYCLE_DESCRIPTOR = "META-INF/maven/lifecycle.xml";
 
+    private static final Pattern PATTERN_FILTER_1 = Pattern.compile("(-?maven-?)|(-?plugin-?)");

Review Comment:
   This I understood as well, but reduction is always good.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven] tbw777 commented on a diff in pull request #984: Speedup by removing non pattern replaceAll with constant arg

Posted by "tbw777 (via GitHub)" <gi...@apache.org>.
tbw777 commented on code in PR #984:
URL: https://github.com/apache/maven/pull/984#discussion_r1099144304


##########
maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java:
##########
@@ -49,6 +50,8 @@ public class PluginDescriptor extends ComponentSetDescriptor implements Cloneabl
 
     private static final String LIFECYCLE_DESCRIPTOR = "META-INF/maven/lifecycle.xml";
 
+    private static final Pattern PATTERN_FILTER_1 = Pattern.compile("(-?maven-?)|(-?plugin-?)");

Review Comment:
   "-?(mave)|(plugi)n-?" ))



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven] tbw777 commented on pull request #984: Speedup by removing non pattern replaceAll with constant arg

Posted by "tbw777 (via GitHub)" <gi...@apache.org>.
tbw777 commented on PR #984:
URL: https://github.com/apache/maven/pull/984#issuecomment-1419732132

   Excuse me i havnt maven jira access


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven] tbw777 commented on pull request #984: Speedup by removing non pattern replaceAll with constant arg

Posted by "tbw777 (via GitHub)" <gi...@apache.org>.
tbw777 commented on PR #984:
URL: https://github.com/apache/maven/pull/984#issuecomment-1420367426

   Its awesome


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven] asfgit closed pull request #984: Speedup by removing non pattern replaceAll with constant arg

Posted by "asfgit (via GitHub)" <gi...@apache.org>.
asfgit closed pull request #984: Speedup by removing non pattern replaceAll with constant arg
URL: https://github.com/apache/maven/pull/984


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven] michael-o commented on pull request #984: Speedup by removing non pattern replaceAll with constant arg

Posted by "michael-o (via GitHub)" <gi...@apache.org>.
michael-o commented on PR #984:
URL: https://github.com/apache/maven/pull/984#issuecomment-1420363153

   No problem, I will create it for you.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven] michael-o commented on pull request #984: Speedup by removing non pattern replaceAll with constant arg

Posted by "michael-o (via GitHub)" <gi...@apache.org>.
michael-o commented on PR #984:
URL: https://github.com/apache/maven/pull/984#issuecomment-1421290456

   Will review as well and take care of JIRA and merge. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven] michael-o commented on a diff in pull request #984: Speedup by removing non pattern replaceAll with constant arg

Posted by "michael-o (via GitHub)" <gi...@apache.org>.
michael-o commented on code in PR #984:
URL: https://github.com/apache/maven/pull/984#discussion_r1099145307


##########
maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java:
##########
@@ -49,6 +50,8 @@ public class PluginDescriptor extends ComponentSetDescriptor implements Cloneabl
 
     private static final String LIFECYCLE_DESCRIPTOR = "META-INF/maven/lifecycle.xml";
 
+    private static final Pattern PATTERN_FILTER_1 = Pattern.compile("(-?maven-?)|(-?plugin-?)");

Review Comment:
   Technically, yes, but reads very very badly



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven] tbw777 commented on a diff in pull request #984: Speedup by removing non pattern replaceAll with constant arg

Posted by "tbw777 (via GitHub)" <gi...@apache.org>.
tbw777 commented on code in PR #984:
URL: https://github.com/apache/maven/pull/984#discussion_r1099125397


##########
maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java:
##########
@@ -175,6 +175,8 @@ public class MavenCli {
 
     private CLIManager cliManager;
 
+    private static final Pattern NEXT_LINE = Pattern.compile("(\r\n)|(\r)|(\n)");

Review Comment:
   DOS & Windows: \r\n 0D0A (hex), 13,10 (decimal)
   Unix & Mac OS X: \n, 0A, 10
   Macintosh (OS 9): \r, 0D, 13
   
   so your pattern not applicable to OS 9 and similar



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven] gnodet commented on a diff in pull request #984: Speedup by removing non pattern replaceAll with constant arg

Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on code in PR #984:
URL: https://github.com/apache/maven/pull/984#discussion_r1098702935


##########
maven-model-transform/src/main/java/org/apache/maven/model/transform/ParentXMLFilter.java:
##########
@@ -47,6 +48,8 @@ class ParentXMLFilter extends NodeBufferingParser {
 
     private final Path projectPath;
 
+    public static final Pattern S_FILTER = Pattern.compile("\\s+");

Review Comment:
   `protected` at least



##########
maven-core/src/main/java/org/apache/maven/internal/MultilineMessageHelper.java:
##########
@@ -29,6 +30,8 @@ public class MultilineMessageHelper {
     private static final int DEFAULT_MAX_SIZE = 65;
     private static final char BOX_CHAR = '*';
 
+    public static final Pattern S_FILTER = Pattern.compile("\\s+");

Review Comment:
   This should be private as it's not an internal detail.



##########
maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluatorV4.java:
##########
@@ -164,7 +164,7 @@ public Object evaluate(String expr, Class<?> type) throws ExpressionEvaluationEx
 
             // Was not an expression
             if (expression.contains("$$")) {

Review Comment:
   I think we should replace those 5 lines with the simple call:
   ```
   return expression.replace("$$", "$");
   ```
   as the `String.replace()` method should exit fast if the searched string can not be found.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven] michael-o commented on a diff in pull request #984: Speedup by removing non pattern replaceAll with constant arg

Posted by "michael-o (via GitHub)" <gi...@apache.org>.
michael-o commented on code in PR #984:
URL: https://github.com/apache/maven/pull/984#discussion_r1099105964


##########
maven-settings-builder/src/main/java/org/apache/maven/settings/validation/DefaultSettingsValidator.java:
##########
@@ -42,11 +43,10 @@
 @Singleton
 public class DefaultSettingsValidator implements SettingsValidator {
 
-    private static final String ID_REGEX = "[A-Za-z0-9_\\-.]+";
+    private static final String ID = "[A-Za-z0-9_\\-.]+";

Review Comment:
   Here, the dot isn't escaped, a few classes above it was. As far as I remember the dot has no special meeting in ranges.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven] tbw777 commented on a diff in pull request #984: Speedup by removing non pattern replaceAll with constant arg

Posted by "tbw777 (via GitHub)" <gi...@apache.org>.
tbw777 commented on code in PR #984:
URL: https://github.com/apache/maven/pull/984#discussion_r1099128409


##########
maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java:
##########
@@ -49,6 +50,8 @@ public class PluginDescriptor extends ComponentSetDescriptor implements Cloneabl
 
     private static final String LIFECYCLE_DESCRIPTOR = "META-INF/maven/lifecycle.xml";
 
+    private static final Pattern PATTERN_FILTER_1 = Pattern.compile("(-?maven-?)|(-?plugin-?)");

Review Comment:
   You are right, my target was to migrate in Patterns firstly



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven] michael-o commented on a diff in pull request #984: Speedup by removing non pattern replaceAll with constant arg

Posted by "michael-o (via GitHub)" <gi...@apache.org>.
michael-o commented on code in PR #984:
URL: https://github.com/apache/maven/pull/984#discussion_r1099105374


##########
maven-settings-builder/src/main/java/org/apache/maven/settings/validation/DefaultSettingsValidator.java:
##########
@@ -42,11 +43,10 @@
 @Singleton
 public class DefaultSettingsValidator implements SettingsValidator {
 
-    private static final String ID_REGEX = "[A-Za-z0-9_\\-.]+";
+    private static final String ID = "[A-Za-z0-9_\\-.]+";

Review Comment:
   You can simplify with `\w` + the rest



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven] michael-o commented on pull request #984: Speedup by removing non pattern replaceAll with constant arg

Posted by "michael-o (via GitHub)" <gi...@apache.org>.
michael-o commented on PR #984:
URL: https://github.com/apache/maven/pull/984#issuecomment-1419665107

   I see your point, will happily review. Can you create a JIRA issue as well?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven] michael-o commented on pull request #984: Speedup by removing non pattern replaceAll with constant arg

Posted by "michael-o (via GitHub)" <gi...@apache.org>.
michael-o commented on PR #984:
URL: https://github.com/apache/maven/pull/984#issuecomment-1421430837

   > -?(maven|plugin)-? vs -?(mave|plugi)n-?
   > 
   > Benchmark (str) Mode Cnt Score Error Units Samples.optionReadablest maven thrpt 28028546,729 ops/s Samples.optionReadablest -maven thrpt 28089177,065 ops/s Samples.optionReadablest -maven- thrpt 27354035,795 ops/s Samples.optionReadablest maven- thrpt 27405551,490 ops/s Samples.optionReadablest plugin thrpt 26609084,140 ops/s Samples.optionReadablest -plugin thrpt 22624237,310 ops/s Samples.optionReadablest -plugin- thrpt 25262851,924 ops/s Samples.optionReadablest plugin- thrpt 26083611,690 ops/s Samples.optionReadablest plg- thrpt 26398601,872 ops/s Samples.optionReadablest -plg thrpt 23522351,419 ops/s Samples.optionReadablest Aplg thrpt 48207314,033 ops/s Samples.optionReadablest 9plg thrpt 48095049,000 ops/s Samples.optionReadablest mvn- thrpt 29054118,637 ops/s Samples.optionReadablest -mvn thrpt 25573418,457 ops/s Samples.optionReadablest Amvn thrpt 47931213,453 ops/s Samples.optionReadablest 9mvn thrpt 47694320,570 ops/s Samples.optionShortest maven thrpt 24051232,421 op
 s/s Samples.optionShortest -maven thrpt 27199371,132 ops/s Samples.optionShortest -maven- thrpt 25518762,078 ops/s Samples.optionShortest maven- thrpt 26033150,732 ops/s Samples.optionShortest plugin thrpt 23824379,011 ops/s Samples.optionShortest -plugin thrpt 25650037,478 ops/s Samples.optionShortest -plugin- thrpt 23597356,044 ops/s Samples.optionShortest plugin- thrpt 25307310,325 ops/s Samples.optionShortest plg- thrpt 27091273,850 ops/s Samples.optionShortest -plg thrpt 24273357,407 ops/s Samples.optionShortest Aplg thrpt 47421101,082 ops/s Samples.optionShortest 9plg thrpt 47822884,484 ops/s Samples.optionShortest mvn- thrpt 28075358,281 ops/s Samples.optionShortest -mvn thrpt 25464723,362 ops/s Samples.optionShortest Amvn thrpt 47988351,004 ops/s Samples.optionShortest 9mvn thrpt 47758122,064 ops/s
   > 
   > I can set any option you want. Because there is no big difference as i see
   
   I see, I prefer readability.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven] tbw777 commented on pull request #984: Speedup by removing non pattern replaceAll with constant arg

Posted by "tbw777 (via GitHub)" <gi...@apache.org>.
tbw777 commented on PR #984:
URL: https://github.com/apache/maven/pull/984#issuecomment-1421443907

   pattern was updated in "File changed" tab to "-?(maven|plugin)-?"


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven] michael-o commented on pull request #984: Speedup by removing non pattern replaceAll with constant arg

Posted by "michael-o (via GitHub)" <gi...@apache.org>.
michael-o commented on PR #984:
URL: https://github.com/apache/maven/pull/984#issuecomment-1421472399

   @tbw777 Thanks for the contribution. I'd highly appreciate a backport from 3.9.x branch to 3.8.x branch.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven] tbw777 commented on a diff in pull request #984: Speedup by removing non pattern replaceAll with constant arg

Posted by "tbw777 (via GitHub)" <gi...@apache.org>.
tbw777 commented on code in PR #984:
URL: https://github.com/apache/maven/pull/984#discussion_r1099144304


##########
maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java:
##########
@@ -49,6 +50,8 @@ public class PluginDescriptor extends ComponentSetDescriptor implements Cloneabl
 
     private static final String LIFECYCLE_DESCRIPTOR = "META-INF/maven/lifecycle.xml";
 
+    private static final Pattern PATTERN_FILTER_1 = Pattern.compile("(-?maven-?)|(-?plugin-?)");

Review Comment:
   -?(mave|plug)n-?
   ))



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven] tbw777 commented on pull request #984: Speedup by removing non pattern replaceAll with constant arg

Posted by "tbw777 (via GitHub)" <gi...@apache.org>.
tbw777 commented on PR #984:
URL: https://github.com/apache/maven/pull/984#issuecomment-1421407846

   Benchmark                    (str)   Mode  Cnt         Score   Error  Units
   Samples.optionReadablest     maven  thrpt       28028546,729          ops/s
   Samples.optionReadablest    -maven  thrpt       28089177,065          ops/s
   Samples.optionReadablest   -maven-  thrpt       27354035,795          ops/s
   Samples.optionReadablest    maven-  thrpt       27405551,490          ops/s
   Samples.optionReadablest    plugin  thrpt       26609084,140          ops/s
   Samples.optionReadablest   -plugin  thrpt       22624237,310          ops/s
   Samples.optionReadablest  -plugin-  thrpt       25262851,924          ops/s
   Samples.optionReadablest   plugin-  thrpt       26083611,690          ops/s
   Samples.optionReadablest      plg-  thrpt       26398601,872          ops/s
   Samples.optionReadablest      -plg  thrpt       23522351,419          ops/s
   Samples.optionReadablest      Aplg  thrpt       48207314,033          ops/s
   Samples.optionReadablest      9plg  thrpt       48095049,000          ops/s
   Samples.optionReadablest      mvn-  thrpt       29054118,637          ops/s
   Samples.optionReadablest      -mvn  thrpt       25573418,457          ops/s
   Samples.optionReadablest      Amvn  thrpt       47931213,453          ops/s
   Samples.optionReadablest      9mvn  thrpt       47694320,570          ops/s
   Samples.optionShortest       maven  thrpt       24051232,421          ops/s
   Samples.optionShortest      -maven  thrpt       27199371,132          ops/s
   Samples.optionShortest     -maven-  thrpt       25518762,078          ops/s
   Samples.optionShortest      maven-  thrpt       26033150,732          ops/s
   Samples.optionShortest      plugin  thrpt       23824379,011          ops/s
   Samples.optionShortest     -plugin  thrpt       25650037,478          ops/s
   Samples.optionShortest    -plugin-  thrpt       23597356,044          ops/s
   Samples.optionShortest     plugin-  thrpt       25307310,325          ops/s
   Samples.optionShortest        plg-  thrpt       27091273,850          ops/s
   Samples.optionShortest        -plg  thrpt       24273357,407          ops/s
   Samples.optionShortest        Aplg  thrpt       47421101,082          ops/s
   Samples.optionShortest        9plg  thrpt       47822884,484          ops/s
   Samples.optionShortest        mvn-  thrpt       28075358,281          ops/s
   Samples.optionShortest        -mvn  thrpt       25464723,362          ops/s
   Samples.optionShortest        Amvn  thrpt       47988351,004          ops/s
   Samples.optionShortest        9mvn  thrpt       47758122,064          ops/s


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org