Skip to content

pgwire: optimize writing in text format#71881

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
yuzefovich:pgwire-write-text
Oct 25, 2021
Merged

pgwire: optimize writing in text format#71881
craig[bot] merged 1 commit intocockroachdb:masterfrom
yuzefovich:pgwire-write-text

Conversation

@yuzefovich
Copy link
Copy Markdown
Member

@yuzefovich yuzefovich commented Oct 22, 2021

This commit removes a couple of closures that were recently introduced
to support different formatting of intervals.

Addresses: #71820.

Release note: None

This commit removes a couple of closures that were recently introduced
to support different formatting of intervals.

Release note: None
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@yuzefovich
Copy link
Copy Markdown
Member Author

name                     old time/op    new time/op    delta
WriteTextBool-24            110ns ± 1%      57ns ± 4%   -48.00%  (p=0.000 n=10+10)
WriteTextInt-24             139ns ± 3%      82ns ± 3%   -40.80%  (p=0.000 n=10+10)
WriteTextFloat-24           267ns ±10%     198ns ± 3%   -25.99%  (p=0.000 n=10+10)
WriteTextDecimal-24         735ns ± 1%     681ns ± 1%    -7.40%  (p=0.000 n=9+9)
WriteTextBytes-24           224ns ± 3%     165ns ± 3%   -26.46%  (p=0.000 n=9+10)
WriteTextUUID-24            168ns ± 2%     109ns ± 2%   -35.14%  (p=0.000 n=10+8)
WriteTextString-24          125ns ± 3%      69ns ± 3%   -44.37%  (p=0.000 n=10+10)
WriteTextDate-24            565ns ± 1%     505ns ± 1%   -10.72%  (p=0.000 n=10+10)
WriteTextTimestamp-24       477ns ± 1%     406ns ± 1%   -14.87%  (p=0.000 n=10+9)
WriteTextTimestampTZ-24     478ns ± 1%     404ns ± 0%   -15.39%  (p=0.000 n=10+9)
WriteTextInterval-24        461ns ± 2%     400ns ± 1%   -13.16%  (p=0.000 n=10+10)
WriteTextTuple-24          1.06µs ± 2%    1.00µs ± 2%    -6.01%  (p=0.000 n=9+10)
WriteTextArray-24          1.27µs ± 2%    1.24µs ± 4%    -2.67%  (p=0.003 n=10+10)

name                     old alloc/op   new alloc/op   delta
WriteTextBool-24            32.0B ± 0%      0.0B       -100.00%  (p=0.000 n=10+10)
WriteTextInt-24             32.0B ± 0%      0.0B       -100.00%  (p=0.000 n=10+10)
WriteTextFloat-24           32.0B ± 0%      0.0B       -100.00%  (p=0.000 n=10+10)
WriteTextDecimal-24          248B ± 0%      216B ± 0%   -12.90%  (p=0.000 n=10+10)
WriteTextBytes-24           64.0B ± 0%     32.0B ± 0%   -50.00%  (p=0.000 n=10+10)
WriteTextUUID-24            32.0B ± 0%      0.0B       -100.00%  (p=0.000 n=10+10)
WriteTextString-24          32.0B ± 0%      0.0B       -100.00%  (p=0.000 n=10+10)
WriteTextDate-24            40.0B ± 0%      8.0B ± 0%   -80.00%  (p=0.000 n=10+10)
WriteTextTimestamp-24       32.0B ± 0%      0.0B       -100.00%  (p=0.000 n=10+10)
WriteTextTimestampTZ-24     32.0B ± 0%      0.0B       -100.00%  (p=0.000 n=10+10)
WriteTextInterval-24        32.0B ± 0%      0.0B       -100.00%  (p=0.000 n=10+10)
WriteTextTuple-24            120B ± 0%       88B ± 0%   -26.67%  (p=0.000 n=10+10)
WriteTextArray-24            536B ± 0%      504B ± 0%    -5.97%  (p=0.000 n=10+10)

name                     old allocs/op  new allocs/op  delta
WriteTextBool-24             1.00 ± 0%      0.00       -100.00%  (p=0.000 n=10+10)
WriteTextInt-24              1.00 ± 0%      0.00       -100.00%  (p=0.000 n=10+10)
WriteTextFloat-24            1.00 ± 0%      0.00       -100.00%  (p=0.000 n=10+10)
WriteTextDecimal-24          7.00 ± 0%      6.00 ± 0%   -14.29%  (p=0.000 n=10+10)
WriteTextBytes-24            3.00 ± 0%      2.00 ± 0%   -33.33%  (p=0.000 n=10+10)
WriteTextUUID-24             1.00 ± 0%      0.00       -100.00%  (p=0.000 n=10+10)
WriteTextString-24           1.00 ± 0%      0.00       -100.00%  (p=0.000 n=10+10)
WriteTextDate-24             2.00 ± 0%      1.00 ± 0%   -50.00%  (p=0.000 n=10+10)
WriteTextTimestamp-24        1.00 ± 0%      0.00       -100.00%  (p=0.000 n=10+10)
WriteTextTimestampTZ-24      1.00 ± 0%      0.00       -100.00%  (p=0.000 n=10+10)
WriteTextInterval-24         1.00 ± 0%      0.00       -100.00%  (p=0.000 n=10+10)
WriteTextTuple-24            7.00 ± 0%      6.00 ± 0%   -14.29%  (p=0.000 n=10+10)
WriteTextArray-24            12.0 ± 0%      11.0 ± 0%    -8.33%  (p=0.000 n=10+10)

@yuzefovich yuzefovich marked this pull request as ready for review October 22, 2021 19:07
@yuzefovich yuzefovich requested review from a team and otan October 22, 2021 19:07
Copy link
Copy Markdown
Contributor

@otan otan left a comment

Choose a reason for hiding this comment

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

nice, thanks!

@yuzefovich
Copy link
Copy Markdown
Member Author

TFTR!

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Oct 25, 2021

Build succeeded:

@craig craig bot merged commit 17d3138 into cockroachdb:master Oct 25, 2021
@yuzefovich yuzefovich deleted the pgwire-write-text branch October 25, 2021 05:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants