Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

executor: remove unnecessary stack for insert and load data #52784

Merged
merged 3 commits into from
Apr 26, 2024

Conversation

jackysp
Copy link
Member

@jackysp jackysp commented Apr 21, 2024

What problem does this PR solve?

Issue Number: close #52783

Problem Summary:

What changed and how does it work?

Add stack when necessary.

master vs. this PR for completeInsertErr

Running tool: /usr/local/go/bin/go test -benchmem -run=^$ -tags intest,deadlock -bench ^BenchmarkCompleteInsertErr$ github.com/pingcap/tidb/pkg/executor

goos: darwin
goarch: arm64
pkg: github.com/pingcap/tidb/pkg/executor
BenchmarkCompleteInsertErr-8   	  383056	      3115 ns/op	     712 B/op	       8 allocs/op
PASS
ok  	github.com/pingcap/tidb/pkg/executor	4.654s

Running tool: /usr/local/go/bin/go test -benchmem -run=^$ -tags intest,deadlock -bench ^BenchmarkCompleteInsertErr$ github.com/pingcap/tidb/pkg/executor

goos: darwin
goarch: arm64
pkg: github.com/pingcap/tidb/pkg/executor
BenchmarkCompleteInsertErr-8   	 3575682	       332.1 ns/op	     200 B/op	       4 allocs/op
PASS
ok  	github.com/pingcap/tidb/pkg/executor	3.827s

master vs. this PR for completeLoadErr

Running tool: /usr/local/go/bin/go test -benchmem -run=^$ -tags intest,deadlock -bench ^BenchmarkCompleteLoadErr$ github.com/pingcap/tidb/pkg/executor

goos: darwin
goarch: arm64
pkg: github.com/pingcap/tidb/pkg/executor
BenchmarkCompleteLoadErr-8   	  595936	      2001 ns/op	     712 B/op	       8 allocs/op
PASS
ok  	github.com/pingcap/tidb/pkg/executor	3.648s

Running tool: /usr/local/go/bin/go test -benchmem -run=^$ -tags intest,deadlock -bench ^BenchmarkCompleteLoadErr$ github.com/pingcap/tidb/pkg/executor

goos: darwin
goarch: arm64
pkg: github.com/pingcap/tidb/pkg/executor
BenchmarkCompleteLoadErr-8   	 6480148	       186.4 ns/op	     200 B/op	       4 allocs/op
PASS
ok  	github.com/pingcap/tidb/pkg/executor	3.937s

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

Signed-off-by: Jack Yu <jackysp@gmail.com>
Signed-off-by: Jack Yu <jackysp@gmail.com>
@ti-chi-bot ti-chi-bot bot added release-note-none size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 21, 2024
@@ -1838,3 +1839,26 @@ func BenchmarkAggPartialResultMapperMemoryUsage(b *testing.B) {
func BenchmarkPipelinedRowNumberWindowFunctionExecution(b *testing.B) {
b.ReportAllocs()
}

func BenchmarkCompleteInsertErr(b *testing.B) {
Copy link
Contributor

Choose a reason for hiding this comment

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

How about adding this to

BenchmarkUnionScanIndexLookUpDescRead,

So you can review the performance changes history like this

Copy link
Member Author

Choose a reason for hiding this comment

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

Done, PTAL @tiancaiamao , thx!

Signed-off-by: Jack Yu <jackysp@gmail.com>
Copy link

codecov bot commented Apr 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.9511%. Comparing base (05422bc) to head (cb75e08).
Report is 44 commits behind head on master.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #52784         +/-   ##
=================================================
- Coverage   70.8106%   55.9511%   -14.8596%     
=================================================
  Files          1473       1595        +122     
  Lines        409033     609407     +200374     
=================================================
+ Hits         289639     340970      +51331     
- Misses       100130     245418     +145288     
- Partials      19264      23019       +3755     
Flag Coverage Δ
integration 36.7981% <88.8888%> (?)
unit 71.2058% <77.7777%> (+1.5713%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 53.9957% <ø> (-2.3014%) ⬇️
parser ∅ <ø> (∅)
br 49.2984% <ø> (+6.5224%) ⬆️

Copy link

ti-chi-bot bot commented Apr 25, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hawkingrei, tiancaiamao

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [hawkingrei,tiancaiamao]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

ti-chi-bot bot commented Apr 25, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-04-21 12:31:02.526564155 +0000 UTC m=+773281.637610596: ☑️ agreed by hawkingrei.
  • 2024-04-25 07:21:19.795552672 +0000 UTC m=+244836.535455584: ☑️ agreed by tiancaiamao.

@tiancaiamao
Copy link
Contributor

/test mysql-test
/test check-dev2

Copy link

tiprow bot commented Apr 26, 2024

@tiancaiamao: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test fast_test_tiprow
  • /test tidb_parser_test

Use /test all to run all jobs.

In response to this:

/test mysql-test
/test check-dev2

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@tiancaiamao
Copy link
Contributor

/test mysql-test

Copy link

tiprow bot commented Apr 26, 2024

@tiancaiamao: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test fast_test_tiprow
  • /test tidb_parser_test

Use /test all to run all jobs.

In response to this:

/test mysql-test

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@ti-chi-bot ti-chi-bot bot merged commit 4cd8e94 into pingcap:master Apr 26, 2024
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The insert statement attached too many unnecessary stacks to the warning.
3 participants