Em qua., 14 de jul. de 2021 às 22:22, David Rowley <dgrowle...@gmail.com>
escreveu:

> On Thu, 15 Jul 2021 at 12:30, Ranier Vilela <ranier...@gmail.com> wrote:
> >
> > Em qua., 14 de jul. de 2021 às 21:21, David Rowley <dgrowle...@gmail.com>
> escreveu:
> >> But, in v8 there is no additional branch, so no branch to mispredict.
> >> I don't really see how your explanation fits.
> >
> > In v8 the branch occurs at :
> > + if (ExecGetResultType(outerPlanState(sortstate))->natts == 1)
>
> You do know that branch is in a function that's only executed once
> during executor initialization, right?
>
The branch prediction should work better.
I have no idea why it works worse.

I redid all tests:
notebook 8GB RAM 256GB SSD
ubuntu 64 bits (20.04)
clang-12
powerhigh (charger on)
none configuration (all defaults)


          HEAD           v6          v7b              v8          v6
vs head
v7b vs v6           v8 vs v7b
Test1 576,868013 940,947236 1090,253859 1016,0443 163,11% 115,87% 93,19%
Test2 184,748363 177,6254 177,346229 178,230258 96,14% 99,84% 100,50%
Test3 410,030055 541,889704 605,843924 534,946166 132,16% 111,80% 88,30%
Test4 153,331752 147,98418 148,010894 147,771155 96,51% 100,02% 99,84%
Test5 268,97555 301,979647 316,928492 300,94932 112,27% 104,95% 94,96%
Test6 234,910125 259,71483 269,851427 260,567637 110,56% 103,90% 96,56%
Test7 142,704153 136,09163 136,802695 136,935709 95,37% 100,52% 100,10%
Test8 498,634855 763,482151 867,350046 804,833884 153,11% 113,60% 92,79%

The values are high here, because now, the tests are made with full power
of cpu to all patchs!
I think that more testing is needed with v7b and v8.

Anyway, two functions (ExecSortTuple and ExecSortDatum) are almost equal,
maybe not a good idea.

file results attached.

regards,
Ranier Vilela
Benchmarks datumSort:

1) head

a)
Test1
tps = 569.209858 (without initial connection time)
tps = 563.220614 (without initial connection time)
tps = 576.868013 (without initial connection time)
Test2
tps = 181.738827 (without initial connection time)
tps = 181.846192 (without initial connection time)
tps = 184.748363 (without initial connection time)
Test3
tps = 403.548507 (without initial connection time)
tps = 403.089439 (without initial connection time)
tps = 402.613085 (without initial connection time)
Test4
tps = 149.144474 (without initial connection time)
tps = 149.399761 (without initial connection time)
tps = 149.154955 (without initial connection time)
Test5
tps = 267.874525 (without initial connection time)
tps = 268.411193 (without initial connection time)
tps = 268.975550 (without initial connection time)
Test6
tps = 233.527790 (without initial connection time)
tps = 233.633064 (without initial connection time)
tps = 234.910125 (without initial connection time)
Test7
tps = 141.286126 (without initial connection time)
tps = 142.704153 (without initial connection time)
tps = 141.205352 (without initial connection time)
Test8
tps = 487.544464 (without initial connection time)
tps = 491.117533 (without initial connection time)
tps = 488.632738 (without initial connection time)

b)
Test1
tps = 566.830371 (without initial connection time)
tps = 570.918955 (without initial connection time)
tps = 568.750619 (without initial connection time)
Test2
tps = 183.407740 (without initial connection time)
tps = 180.912646 (without initial connection time)
tps = 180.520571 (without initial connection time)
Test3
tps = 407.706768 (without initial connection time)
tps = 410.030055 (without initial connection time)
tps = 408.764070 (without initial connection time)
Test4
tps = 153.331752 (without initial connection time)
tps = 150.824075 (without initial connection time)
tps = 151.791484 (without initial connection time)
Test5
tps = 267.737001 (without initial connection time)
tps = 268.400295 (without initial connection time)
tps = 267.696627 (without initial connection time)
Test6
tps = 232.793249 (without initial connection time)
tps = 232.996156 (without initial connection time)
tps = 233.452329 (without initial connection time)
Test7
tps = 142.180635 (without initial connection time)
tps = 141.762886 (without initial connection time)
tps = 141.488497 (without initial connection time)
Test8
tps = 489.623012 (without initial connection time)
tps = 498.634855 (without initial connection time)
tps = 491.009624 (without initial connection time)


2) v6 Ronan

a)
Test1
tps = 937.913563 (without initial connection time)
tps = 940.947236 (without initial connection time)
tps = 934.811056 (without initial connection time)
Test2
tps = 176.990496 (without initial connection time)
tps = 177.242999 (without initial connection time)
tps = 177.625400 (without initial connection time)
Test3
tps = 539.970412 (without initial connection time)
tps = 540.415402 (without initial connection time)
tps = 541.889704 (without initial connection time)
Test4
tps = 147.006777 (without initial connection time)
tps = 147.984180 (without initial connection time)
tps = 147.605122 (without initial connection time)
Test5
tps = 301.528886 (without initial connection time)
tps = 301.979647 (without initial connection time)
tps = 301.608505 (without initial connection time)
Test6
tps = 259.714830 (without initial connection time)
tps = 258.814002 (without initial connection time)
tps = 259.191187 (without initial connection time)
Test7
tps = 135.385311 (without initial connection time)
tps = 134.929351 (without initial connection time)
tps = 136.091630 (without initial connection time)
Test8
tps = 750.719143 (without initial connection time)
tps = 738.618022 (without initial connection time)
tps = 746.489803 (without initial connection time)


b)
Test1
tps = 935.695628 (without initial connection time)
tps = 925.605056 (without initial connection time)
tps = 929.254826 (without initial connection time)
Test2
tps = 174.757674 (without initial connection time)
tps = 176.595991 (without initial connection time)
tps = 176.725643 (without initial connection time)
Test3
tps = 540.489515 (without initial connection time)
tps = 539.974841 (without initial connection time)
tps = 540.591729 (without initial connection time)
Test4
tps = 147.801759 (without initial connection time)
tps = 146.567638 (without initial connection time)
tps = 146.603782 (without initial connection time)
Test5
tps = 300.508474 (without initial connection time)
tps = 300.944235 (without initial connection time)
tps = 301.048430 (without initial connection time)
Test6
tps = 258.874035 (without initial connection time)
tps = 258.263766 (without initial connection time)
tps = 258.310823 (without initial connection time)
Test7
tps = 135.331319 (without initial connection time)
tps = 135.703623 (without initial connection time)
tps = 135.490705 (without initial connection time)
Test8
tps = 742.677610 (without initial connection time)
tps = 747.259482 (without initial connection time)
tps = 763.482151 (without initial connection time)


3) v7b Ranier

a)
Test1
tps = 1082.980858 (without initial connection time)
tps = 1072.578191 (without initial connection time)
tps = 1090.253859 (without initial connection time)
Test2
tps = 175.986713 (without initial connection time)
tps = 176.857218 (without initial connection time)
tps = 177.346229 (without initial connection time)
Test3
tps = 589.062971 (without initial connection time)
tps = 590.087077 (without initial connection time)
tps = 589.403242 (without initial connection time)
Test4
tps = 147.079424 (without initial connection time)
tps = 147.227593 (without initial connection time)
tps = 147.326587 (without initial connection time)
Test5
tps = 313.068224 (without initial connection time)
tps = 312.826058 (without initial connection time)
tps = 312.281232 (without initial connection time)
Test6
tps = 267.413932 (without initial connection time)
tps = 267.089049 (without initial connection time)
tps = 267.680004 (without initial connection time)
Test7
tps = 136.300286 (without initial connection time)
tps = 135.785729 (without initial connection time)
tps = 136.802695 (without initial connection time)
Test8
tps = 849.538229 (without initial connection time)
tps = 848.782587 (without initial connection time)
tps = 843.663950 (without initial connection time)

b)
Test1
tps = 1080.363559 (without initial connection time)
tps = 1069.696487 (without initial connection time)
tps = 1069.979071 (without initial connection time)
Test2
tps = 176.303032 (without initial connection time)
tps = 177.125488 (without initial connection time)
tps = 176.730545 (without initial connection time)
Test3
tps = 589.831320 (without initial connection time)
tps = 605.843924 (without initial connection time)
tps = 589.840699 (without initial connection time)
Test4
tps = 147.323186 (without initial connection time)
tps = 147.758672 (without initial connection time)
tps = 148.010894 (without initial connection time)
Test5
tps = 314.951497 (without initial connection time)
tps = 316.928492 (without initial connection time)
tps = 316.102529 (without initial connection time)
Test6
tps = 270.379992 (without initial connection time)
tps = 269.851427 (without initial connection time)
tps = 267.661778 (without initial connection time)
Test7
tps = 135.457480 (without initial connection time)
tps = 135.244820 (without initial connection time)
tps = 135.454365 (without initial connection time)
Test8
tps = 867.350046 (without initial connection time)
tps = 846.182926 (without initial connection time)
tps = 839.076524 (without initial connection time)


4) v8 David

a)
Test1
tps = 945.486355 (without initial connection time)
tps = 937.105049 (without initial connection time)
tps = 1016.044300 (without initial connection time)
Test2
tps = 177.123805 (without initial connection time)
tps = 176.022832 (without initial connection time)
tps = 178.230258 (without initial connection time)
Test3
tps = 533.977961 (without initial connection time)
tps = 533.434940 (without initial connection time)
tps = 534.946166 (without initial connection time)
Test4
tps = 147.831199 (without initial connection time)
tps = 147.065792 (without initial connection time)
tps = 147.658847 (without initial connection time)
Test5
tps = 300.949320 (without initial connection time)
tps = 300.400180 (without initial connection time)
tps = 300.538198 (without initial connection time)
Test6
tps = 258.215364 (without initial connection time)
tps = 259.333376 (without initial connection time)
tps = 258.069677 (without initial connection time)
Test7
tps = 136.935709 (without initial connection time)
tps = 136.084010 (without initial connection time)
tps = 136.540973 (without initial connection time)
Test8
tps = 766.412186 (without initial connection time)
tps = 767.807064 (without initial connection time)
tps = 761.704266 (without initial connection time)

b)
Test1
tps = 951.310378 (without initial connection time)
tps = 952.482675 (without initial connection time)
tps = 945.763177 (without initial connection time)
Test2
tps = 177.201967 (without initial connection time)
tps = 177.604298 (without initial connection time)
tps = 177.962450 (without initial connection time)
Test3
tps = 533.975077 (without initial connection time)
tps = 531.519294 (without initial connection time)
tps = 533.226288 (without initial connection time)
Test4
tps = 147.447597 (without initial connection time)
tps = 147.771155 (without initial connection time)
tps = 147.579339 (without initial connection time)
Test5
tps = 300.715066 (without initial connection time)
tps = 300.893952 (without initial connection time)
tps = 300.363716 (without initial connection time)
Test6
tps = 260.567637 (without initial connection time)
tps = 258.092825 (without initial connection time)
tps = 258.465495 (without initial connection time)
Test7
tps = 136.596367 (without initial connection time)
tps = 135.667847 (without initial connection time)
tps = 135.781126 (without initial connection time)
Test8
tps = 761.294553 (without initial connection time)
tps = 766.808742 (without initial connection time)
tps = 804.833884 (without initial connection time)

Reply via email to