Commit 14ff44f
committed
Used optimized linear search in more code paths
This commit updates two code paths to use pg_lfind32() introduced by
b6ef167 with TransactionId arrays:
- At the end of TransactionIdIsInProgress(), when checking for the case
of still running but overflowed subxids.
- XidIsConcurrent(), when checking for a serializable conflict.
These cases are less impactful than 37a6e5d, but a bit of
micro-benchmarking of this API shows that linear search speeds up by
~20% depending on the number of items involved (x86_64 and amd64 looked
at here).
Author: Nathan Bossart
Reviewed-by: Richard Guo, Michael Paquier
Discussion: https://postgr.es/m/20220901185153.GA783106@nathanxps131 parent 9a69152 commit 14ff44f
2 files changed
+6
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
| |||
1586 | 1587 | | |
1587 | 1588 | | |
1588 | 1589 | | |
1589 | | - | |
1590 | | - | |
1591 | | - | |
1592 | | - | |
1593 | | - | |
1594 | | - | |
1595 | | - | |
1596 | | - | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
1597 | 1593 | | |
1598 | 1594 | | |
1599 | 1595 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| 205 | + | |
205 | 206 | | |
206 | 207 | | |
207 | 208 | | |
| |||
4065 | 4066 | | |
4066 | 4067 | | |
4067 | 4068 | | |
4068 | | - | |
4069 | 4069 | | |
4070 | 4070 | | |
4071 | 4071 | | |
| |||
4078 | 4078 | | |
4079 | 4079 | | |
4080 | 4080 | | |
4081 | | - | |
4082 | | - | |
4083 | | - | |
4084 | | - | |
4085 | | - | |
4086 | | - | |
4087 | | - | |
| 4081 | + | |
4088 | 4082 | | |
4089 | 4083 | | |
4090 | 4084 | | |
| |||
0 commit comments