Skip to content

parser: optimize performance#562

Merged
zz-jason merged 2 commits into
pingcap:masterfrom
lauhg:optimize-performance
Sep 24, 2019
Merged

parser: optimize performance#562
zz-jason merged 2 commits into
pingcap:masterfrom
lauhg:optimize-performance

Conversation

@lauhg
Copy link
Copy Markdown
Contributor

@lauhg lauhg commented Sep 20, 2019

What problem does this PR solve?

Optimizing parser performance

What is changed and how it works?

Here is the benchmark, 8%~12% faster than before:

goos: linux
goarch: amd64

Before optimization:

BenchmarkSysbenchSelect       200000          6121 ns/op        1824 B/op         20 allocs/op
BenchmarkParseComplex          10000        223586 ns/op        61772 B/op        642 allocs/op
BenchmarkParseSimple          100000         19047 ns/op        5144 B/op         71 allocs/op

After optimization:

BenchmarkSysbenchSelect       200000          5586 ns/op        1824 B/op         20 allocs/op
BenchmarkParseComplex          10000        206988 ns/op        61772 B/op        642 allocs/op
BenchmarkParseSimple          100000         16873 ns/op        5144 B/op         71 allocs/op

Check List

Tests

Unit test

@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 20, 2019

Codecov Report

Merging #562 into master will increase coverage by <.01%.
The diff coverage is 40%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #562      +/-   ##
==========================================
+ Coverage   71.76%   71.77%   +<.01%     
==========================================
  Files          32       32              
  Lines        7813     7811       -2     
==========================================
- Hits         5607     5606       -1     
+ Misses       1676     1675       -1     
  Partials      530      530
Impacted Files Coverage Δ
yy_parser.go 83.46% <ø> (ø) ⬆️
goyacc/main.go 0% <0%> (ø) ⬆️
parser.go 70.37% <80%> (-0.22%) ⬇️
ast/functions.go 76.74% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 33636bc...6a0bfe2. Read the comment docs.

@tiancaiamao
Copy link
Copy Markdown
Collaborator

LGTM
I've tested this branch with TiDB and the CI passed.

@tiancaiamao
Copy link
Copy Markdown
Collaborator

PTAL @winkyao @zz-jason

Copy link
Copy Markdown
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zz-jason zz-jason added status/LGT2 LGT2 and removed status/LGT1 LGT1 labels Sep 24, 2019
@zz-jason zz-jason merged commit 8a4248b into pingcap:master Sep 24, 2019
tiancaiamao pushed a commit to tiancaiamao/parser that referenced this pull request Apr 27, 2021
lyonzhi pushed a commit to lyonzhi/parser that referenced this pull request Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants