You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/06/02 07:03:48 UTC

[GitHub] [shardingsphere] tuichenchuxin opened a new pull request, #18152: little optimize SubstitutableColumnNameToken.toString method

tuichenchuxin opened a new pull request, #18152:
URL: https://github.com/apache/shardingsphere/pull/18152

   Fixes #15686.
   
   Changes proposed in this pull request:
   - little optimize SubstitutableColumnNameToken.toString method
   
   ## Before 
   Benchmark                Mode  Cnt        Score        Error  Units
   MyBenchmark.testMethod  thrpt   25  5227119.076 ± 100902.024  ops/s
   ## After
   Benchmark                Mode  Cnt        Score        Error  Units
   MyBenchmark.testMethod  thrpt   25  5351136.903 ± 175651.198  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: notifications-unsubscribe@shardingsphere.apache.org

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


[GitHub] [shardingsphere] strongduanmu merged pull request #18152: little optimize SubstitutableColumnNameToken.toString method

Posted by GitBox <gi...@apache.org>.
strongduanmu merged PR #18152:
URL: https://github.com/apache/shardingsphere/pull/18152


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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


[GitHub] [shardingsphere] TeslaCN commented on a diff in pull request #18152: little optimize SubstitutableColumnNameToken.toString method

Posted by GitBox <gi...@apache.org>.
TeslaCN commented on code in PR #18152:
URL: https://github.com/apache/shardingsphere/pull/18152#discussion_r889772079


##########
shardingsphere-infra/shardingsphere-infra-rewrite/src/main/java/org/apache/shardingsphere/infra/rewrite/sql/token/pojo/generic/SubstitutableColumnNameToken.java:
##########
@@ -76,11 +76,17 @@ public SubstitutableColumnNameToken(final int startIndex, final int stopIndex, f
     @Override
     public String toString(final RouteUnit routeUnit) {
         Map<String, String> logicAndActualTables = getLogicAndActualTables(routeUnit);
-        StringBuilder builder = lastColumn ? new StringBuilder(COLUMN_NAME_SPLITTER) : new StringBuilder();
+        StringBuilder result = new StringBuilder();

Review Comment:
   How about the `java.util.StringJoiner`?



-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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


[GitHub] [shardingsphere] tuichenchuxin commented on a diff in pull request #18152: little optimize SubstitutableColumnNameToken.toString method

Posted by GitBox <gi...@apache.org>.
tuichenchuxin commented on code in PR #18152:
URL: https://github.com/apache/shardingsphere/pull/18152#discussion_r889772932


##########
shardingsphere-infra/shardingsphere-infra-rewrite/src/main/java/org/apache/shardingsphere/infra/rewrite/sql/token/pojo/generic/SubstitutableColumnNameToken.java:
##########
@@ -76,11 +76,17 @@ public SubstitutableColumnNameToken(final int startIndex, final int stopIndex, f
     @Override
     public String toString(final RouteUnit routeUnit) {
         Map<String, String> logicAndActualTables = getLogicAndActualTables(routeUnit);
-        StringBuilder builder = lastColumn ? new StringBuilder(COLUMN_NAME_SPLITTER) : new StringBuilder();
+        StringBuilder result = new StringBuilder();

Review Comment:
   I have tried StringJoiner, but the performance is not good enough.



-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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


[GitHub] [shardingsphere] codecov-commenter commented on pull request #18152: little optimize SubstitutableColumnNameToken.toString method

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #18152:
URL: https://github.com/apache/shardingsphere/pull/18152#issuecomment-1144580080

   # [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/18152?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#18152](https://codecov.io/gh/apache/shardingsphere/pull/18152?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (64b74fe) into [master](https://codecov.io/gh/apache/shardingsphere/commit/1b77c33983198a420e974a302d2a891ca05ae664?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (1b77c33) will **increase** coverage by `0.00%`.
   > The diff coverage is `71.42%`.
   
   > :exclamation: Current head 64b74fe differs from pull request most recent head e6c3849. Consider uploading reports for the commit e6c3849 to get more accurate results
   
   ```diff
   @@            Coverage Diff            @@
   ##             master   #18152   +/-   ##
   =========================================
     Coverage     59.07%   59.08%           
     Complexity     2170     2170           
   =========================================
     Files          3692     3692           
     Lines         54362    54366    +4     
     Branches       9246     9246           
   =========================================
   + Hits          32117    32123    +6     
   + Misses        19501    19499    -2     
     Partials       2744     2744           
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/18152?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ken/pojo/generic/SubstitutableColumnNameToken.java](https://codecov.io/gh/apache/shardingsphere/pull/18152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtcmV3cml0ZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvaW5mcmEvcmV3cml0ZS9zcWwvdG9rZW4vcG9qby9nZW5lcmljL1N1YnN0aXR1dGFibGVDb2x1bW5OYW1lVG9rZW4uamF2YQ==) | `68.29% <71.42%> (+0.72%)` | :arrow_up: |
   | [...d/text/distsql/ral/common/hint/HintSourceType.java](https://codecov.io/gh/apache/shardingsphere/pull/18152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC90ZXh0L2Rpc3RzcWwvcmFsL2NvbW1vbi9oaW50L0hpbnRTb3VyY2VUeXBlLmphdmE=) | `42.85% <0.00%> (+42.85%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/18152?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/18152?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [1b77c33...e6c3849](https://codecov.io/gh/apache/shardingsphere/pull/18152?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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