Improve performance of float overflow checks in btree_gist
Michael Paquier <michael@paquier.xyz>
Improve performance of float overflow checks in btree_gist The current code could do unnecessary calls to isinf() (two for the argument values all the time while one could be sufficient in some cases). zero_is_valid was never used but the result value was still checked on 0 in the first position of the check. This is similar to 607f8ce. btree_gist has just copy-pasted the code doing those checks from the backend float4/8 code, as of the macro CHECKFLOATVAL(), to do the work. Author: Haiying Tang Discussion: https://postgr.es/m/OS0PR01MB611358E3A7BC3C2F874AC36BFBF39@OS0PR01MB6113.jpnprd01.prod.outlook.com
Files
| Path | Change | +/− |
|---|---|---|
| contrib/btree_gist/btree_float4.c | modified | +3 −1 |
| contrib/btree_gist/btree_float8.c | modified | +5 −3 |
| contrib/btree_gist/btree_utils_num.h | modified | +0 −17 |
Discussion
- [PATCH]Remove obsolete macro CHECKFLOATVAL in btree_gist 5 messages · 2021-08-06 → 2021-08-19