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 2021/10/14 08:59:00 UTC
[GitHub] [shardingsphere] xuanyuan300 opened a new issue #13040: mysql grammar optimize
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] strongduanmu commented on issue #13040: mysql grammar optimize
Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #13040:
URL: https://github.com/apache/shardingsphere/issues/13040#issuecomment-943206345
@xuanyuan300 This optimization looks great, we will try to optimize parsing engine of java version later.
--
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