xuanyuan300 opened a new issue, #13040:
URL: https://github.com/apache/shardingsphere/issues/13040

   Currenty, I'm using sql grammar of Sharding-Sphere in a golang project.I 
will improve the parsing perfomance by reduceing the count of rules's 
branch.The following is my updated code and test data.
   
   
   ```bitExpr
       : bitExpr (
           VERTICAL_BAR_
           | AMPERSAND_
           | SIGNED_LEFT_SHIFT_
           | SIGNED_RIGHT_SHIFT_
           | PLUS_
           | MINUS_
           | ASTERISK_
           | SLASH_
           | DIV
           | MOD
           | MOD_
           | CARET_
           | PLUS_
           | MINUS_
           ) bitExpr
   ```
   test data:
   sql :  "select * from user where id=?"
   **before**: 
   ```
   goos: darwin
   goarch: amd64
   cpu: Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
   BenchmarkTestSelect-8           1000000000               0.08437 ns/op
   BenchmarkTestSelect-8           1000000000               0.08279 ns/op
   BenchmarkTestSelect-8           1000000000               0.08233 ns/op
   BenchmarkTestSelect-8           1000000000               0.08355 ns/op
   BenchmarkTestSelect-8           1000000000               0.08285 ns/op
   BenchmarkTestSelect-8           1000000000               0.08447 ns/op
   BenchmarkTestSelect-8           1000000000               0.08360 ns/op
   BenchmarkTestSelect-8           1000000000               0.08244 ns/op
   BenchmarkTestSelect-8           1000000000               0.08285 ns/op
   BenchmarkTestSelect-8           1000000000               0.08347 ns/op
   
   ```
   **after**: 
   ```
   goos: darwin
   goarch: amd64
   cpu: Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
   BenchmarkTestSelect-8           1000000000               0.07054 ns/op
   BenchmarkTestSelect-8           1000000000               0.06725 ns/op
   BenchmarkTestSelect-8           1000000000               0.06685 ns/op
   BenchmarkTestSelect-8           1000000000               0.06829 ns/op
   BenchmarkTestSelect-8           1000000000               0.07770 ns/op
   BenchmarkTestSelect-8           1000000000               0.06968 ns/op
   BenchmarkTestSelect-8           1000000000               0.06808 ns/op
   BenchmarkTestSelect-8           1000000000               0.06731 ns/op
   BenchmarkTestSelect-8           1000000000               0.06728 ns/op
   BenchmarkTestSelect-8           1000000000               0.06778 ns/op
   
   ```
   incress about **20%**
   
   I don’t know whether it is effective for java, Is there any plan to optimize 
this problem,I am happy to help.


-- 
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: 
[email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to