You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@eventmesh.apache.org by "Alonexc (via GitHub)" <gi...@apache.org> on 2023/03/17 01:54:27 UTC

[GitHub] [incubator-eventmesh] Alonexc opened a new issue, #3476: [Enhancement] Replace this call to "replaceAll()" by a call to the "replace()" method.[ PushConsumerImpl]

Alonexc opened a new issue, #3476:
URL: https://github.com/apache/incubator-eventmesh/issues/3476

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/eventmesh/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### Enhancement Request
   
   ![image](https://user-images.githubusercontent.com/91315508/225790786-82e2b2df-0b57-472b-a0f0-c5e9641f4230.png)
   ![image](https://user-images.githubusercontent.com/91315508/225790797-77b8679a-1855-4cee-acf6-e40c59118c18.png)
   located at:
   eventmesh-connector-plugin/eventmesh-connector-rocketmq/src/main/java/org/apache/eventmesh/connector/rocketmq/consumer/PushConsumerImpl.java line 189,261
   analysis and explanation:
   The underlying implementation of String::replaceAll calls the java.util.regex.Pattern.compile() method each time it is called even if the first argument is not a regular expression. This has a significant performance cost and therefore should be used with care.
   When String::replaceAll is used, the first argument should be a real regular expression. If it’s not the case, String::replace does exactly the same thing as String::replaceAll without the performance drawback of the regex.
   
   
   ### Describe the solution you'd like
   
   a. Use "replace()" instead of "replaceAll()".
   b. Delete the commented out code.
   
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!


-- 
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@eventmesh.apache.org.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org


[GitHub] [eventmesh] Alonexc closed issue #3476: [Enhancement] Replace this call to "replaceAll()" by a call to the "replace()" method.[PushConsumerImpl]

Posted by "Alonexc (via GitHub)" <gi...@apache.org>.
Alonexc closed issue #3476: [Enhancement] Replace this call to "replaceAll()" by a call to the "replace()" method.[PushConsumerImpl]
URL: https://github.com/apache/eventmesh/issues/3476


-- 
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@eventmesh.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org