aboutsummaryrefslogtreecommitdiff
path: root/src/common/file_utils.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2020-09-06 21:40:39 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2020-09-06 21:40:39 -0400
commit88709176236caf3cb9655acda6bad2df0323ac8f (patch)
treed9b871a8d92bf1caf6d4a00ba51344f9d2665b4e /src/common/file_utils.c
parent695de5d1eda6382b20fadb0a2b2d286b57a6a61c (diff)
downloadpostgresql-88709176236caf3cb9655acda6bad2df0323ac8f.tar.gz
postgresql-88709176236caf3cb9655acda6bad2df0323ac8f.zip
Apply auto-vectorization to the inner loop of numeric multiplication.
Compile numeric.c with -ftree-vectorize where available, and adjust the innermost loop of mul_var() so that it is amenable to being auto-vectorized. (Mainly, that involves making it process the arrays left-to-right not right-to-left.) Applying -ftree-vectorize actually makes numeric.o smaller, at least with my compiler (gcc 8.3.1 on x86_64), and it's a little faster too. Independently of that, fixing the inner loop to be vectorizable also makes things a bit faster. But doing both is a huge win for multiplications with lots of digits. For me, the numeric regression test is the same speed to within measurement noise, but numeric_big is a full 45% faster. We also looked into applying -funroll-loops, but that makes numeric.o bloat quite a bit, and the additional speed improvement is very marginal. Amit Khandekar, reviewed and edited a little by me Discussion: https://postgr.es/m/CAJ3gD9evtA_vBo+WMYMyT-u=keHX7-r8p2w7OSRfXf42LTwCZQ@mail.gmail.com
Diffstat (limited to 'src/common/file_utils.c')
0 files changed, 0 insertions, 0 deletions