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

*: wrap the previous statement for performance #12283

Merged
merged 3 commits into from
Sep 23, 2019

Conversation

jackysp
Copy link
Member

@jackysp jackysp commented Sep 19, 2019

Signed-off-by: Shuaipeng Yu [email protected]

What problem does this PR solve?

Formating a long previous statement takes too many resources, which may hurt the performance.

What is changed and how it works?

Warp it to a fmt.Stringer.

Check List

Tests

  • Unit test

Code changes

  • Has exported function/method change

Related changes

  • Need to cherry-pick to the release branch

@jackysp jackysp added the type/enhancement The issue or PR belongs to an enhancement. label Sep 19, 2019
@jackysp
Copy link
Member Author

jackysp commented Sep 19, 2019

/bench

@jackysp jackysp requested a review from lysu September 19, 2019 15:23
Signed-off-by: Shuaipeng Yu <[email protected]>
@sre-bot
Copy link
Contributor

sre-bot commented Sep 19, 2019

@@                               Benchmark Diff                               @@
================================================================================
--- tidb: f9724dbf3bcb9fc58d0d854391c0ba9f87c3fbd4
+++ tidb: a5c26bb56a590fa78aea6999edfbf88693c21c5d
tikv: f2bb322e6fffd72c26f0ef268f99e0d8441389aa
pd: 4ca2265d180531191dcfc531e468ab8380737a33
================================================================================
test-1: < oltp_read_write >
    * QPS : 37202.67 ± 0.2127% (std=54.65) delta: 0.63%
    * AvgMs : 138.17 ± 0.2334% (std=0.22) delta: -0.61%
    * PercentileMs99 : 267.41 ± 0.0000% (std=0.00) delta: 0.00%
            
test-2: < oltp_point_select >
    * QPS : 81827.59 ± 1.2476% (std=707.11) delta: 0.95%
    * AvgMs : 3.13 ± 1.2780% (std=0.03) delta: -0.84%
    * PercentileMs99 : 6.65 ± 2.1667% (std=0.09) delta: 0.36%
            
test-3: < oltp_insert >
    * QPS : 21895.46 ± 0.1378% (std=23.21) delta: 0.16%
    * AvgMs : 11.68 ± 0.1427% (std=0.01) delta: -0.19%
    * PercentileMs99 : 23.95 ± 0.0000% (std=0.00) delta: 0.00%
            
test-4: < oltp_update_index >
    * QPS : 17145.03 ± 0.2801% (std=32.67) delta: 0.33%
    * AvgMs : 14.86 ± 0.5517% (std=0.07) delta: -0.09%
    * PercentileMs99 : 30.48 ± 1.0827% (std=0.27) delta: -0.36%
            
test-5: < oltp_update_non_index >
    * QPS : 29141.14 ± 0.2300% (std=46.86) delta: 0.32%
    * AvgMs : 8.78 ± 0.2278% (std=0.01) delta: -0.23%
    * PercentileMs99 : 18.61 ± 0.0000% (std=0.00) delta: 0.00%
            

https://perf.pingcap.com

Copy link
Contributor

@lysu lysu left a comment

Choose a reason for hiding this comment

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

LGTM

@jackysp
Copy link
Member Author

jackysp commented Sep 23, 2019

PTAL @lonng

Copy link
Contributor

@lonng lonng left a comment

Choose a reason for hiding this comment

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

LGTM

@lonng lonng added the status/can-merge Indicates a PR has been approved by a committer. label Sep 23, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Sep 23, 2019

/run-all-tests

@sre-bot sre-bot merged commit 582076b into pingcap:master Sep 23, 2019
@codecov
Copy link

codecov bot commented Sep 23, 2019

Codecov Report

Merging #12283 into master will not change coverage.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             master     #12283   +/-   ##
===========================================
  Coverage   81.2741%   81.2741%           
===========================================
  Files           454        454           
  Lines        100049     100049           
===========================================
  Hits          81314      81314           
  Misses        12928      12928           
  Partials       5807       5807

@jackysp
Copy link
Member Author

jackysp commented Sep 23, 2019

Wide table batch insert case:

Version:
tidb: ed610881ac14e235d0ab3c0092276dfb226a0a29(HEAD) 2019-09-19 04:04:18
tikv: 15082b6cb7d1be3414badc0b74a21b67a505a29e(master) 2019-09-20 05:47:23
pd: 4ca2265d180531191dcfc531e468ab8380737a33(master) 2019-09-18 08:29:29

Compare:
tidb: https://github.com/pingcap/tidb/compare/8cb488a...ed61088
tikv: https://github.com/tikv/tikv/compare/15082b6...15082b6
pd: https://github.com/pingcap/pd/compare/4ca2265...4ca2265

tidb_max_cpu: 22.76, delta: -0.62%
tikv_max_cpu: 1.77, delta: 1.84%
tidb_max_memory: 543.75 MiB, delta: -1.04%
tikv_max_memory: 1220.92 MiB, delta: -8.27%

tps: 4304.40 ± 0.5379% (std=12.72) delta: 2.76%
qps: 17577.92 ± 0.4999% (std=44.58) delta: 2.76%
lat_avg: 59.47 ± 0.5263% (std=0.18) delta: -2.69%
lat_99th: 170.48 ± 0.0000% (std=0.00) delta: 1.82%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/can-merge Indicates a PR has been approved by a committer. type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants