Optimize numeric multiplication for one and two base-NBASE digit multiplicands. - Mailing list pgsql-hackers

From Joel Jacobson
Subject Optimize numeric multiplication for one and two base-NBASE digit multiplicands.
Date
Msg-id 44d2ffca-d560-4919-b85a-4d07060946aa@app.fastmail.com
Whole thread Raw
Responses Re: Optimize numeric multiplication for one and two base-NBASE digit multiplicands.
Re: Optimize numeric multiplication for one and two base-NBASE digit multiplicands.
List pgsql-hackers
Hello hackers,

Attached patch introduces an optimization of mul_var() in numeric.c, targeting cases where the multiplicands consist of
onlyone or two base-NBASE digits. Such small multiplicands can fit into an int64 and thus be computed directly,
resultingin a significant performance improvement, between 26% - 34% benchmarked on Intel Core i9-14900K.
 

This optimization is similar to commit d1b307eef2, that also targeted one and two base-NBASE digit operands, but
optimizeddiv_var().
 

Regards,
Joel
Attachment

pgsql-hackers by date:

Previous
From: Ashutosh Bapat
Date:
Subject: Re: Reuse child_relids in try_partitionwise_join was Re: Assert failure on bms_equal(child_joinrel->relids, child_joinrelids)
Next
From: Michael Paquier
Date:
Subject: Re: [PATCH] Fix docs to use canonical links