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

infoschema: avoid strings.toUpper in the IsClusterTableByName #59608

Merged
merged 7 commits into from
Feb 19, 2025

Conversation

hawkingrei
Copy link
Member

@hawkingrei hawkingrei commented Feb 18, 2025

What problem does this PR solve?

Issue Number: close #59606

Problem Summary:

What changed and how does it work?

Image

in fact, They have been upper.

memTableToAllTiDBClusterTables and memTableToDDLOwnerClusterTables have been upper. the parameters of IsClusterTableByName have been upper, too.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
func BenchmarkIsClusterTableByName(b *testing.B) {
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		infoschema.IsClusterTableByName("test", "t1")
	}
}

before

BenchmarkIsClusterTableByName
BenchmarkIsClusterTableByName-8   	55993436	        20.92 ns/op

after

BenchmarkIsClusterTableByName
BenchmarkIsClusterTableByName-8   	895389862	         1.412 ns/op
  • 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: Weizhen Wang <wangweizhen@pingcap.com>
@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-tests-checked release-note-none Denotes a PR that doesn't merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed do-not-merge/needs-tests-checked labels Feb 18, 2025
@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Feb 18, 2025
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
Copy link

codecov bot commented Feb 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.7753%. Comparing base (8059751) to head (928c951).
Report is 15 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #59608        +/-   ##
================================================
+ Coverage   73.0128%   74.7753%   +1.7625%     
================================================
  Files          1694       1740        +46     
  Lines        468330     480808     +12478     
================================================
+ Hits         341941     359526     +17585     
+ Misses       105359      98660      -6699     
- Partials      21030      22622      +1592     
Flag Coverage Δ
integration 48.9778% <100.0000%> (?)
unit 72.1922% <100.0000%> (-0.0228%) ⬇️

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

Components Coverage Δ
dumpling 52.6910% <ø> (ø)
parser ∅ <ø> (∅)
br 60.8023% <ø> (+15.5796%) ⬆️

Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
@ti-chi-bot ti-chi-bot bot added sig/planner SIG: Planner size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Feb 18, 2025
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
@hawkingrei
Copy link
Member Author

/retest

1 similar comment
@hawkingrei
Copy link
Member Author

/retest

Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 19, 2025
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Feb 19, 2025
Copy link

ti-chi-bot bot commented Feb 19, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-02-18 08:47:34.320133233 +0000 UTC m=+951096.716355294: ☑️ agreed by Defined2014.
  • 2025-02-19 06:32:44.139430343 +0000 UTC m=+1029406.535652404: ☑️ agreed by tangenta.

Copy link

ti-chi-bot bot commented Feb 19, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Defined2014, tangenta, winoros

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:

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

@ti-chi-bot ti-chi-bot bot added the approved label Feb 19, 2025
@ti-chi-bot ti-chi-bot bot merged commit 7a4c20e into pingcap:master Feb 19, 2025
26 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 Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner 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.

strings.ToUpper is useless in the isClusterTableByName
4 participants