forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit14ff44f
committed
Used optimized linear search in more code paths
This commit updates two code paths to use pg_lfind32() introduced byb6ef167 with TransactionId arrays:- At the end of TransactionIdIsInProgress(), when checking for the caseof still running but overflowed subxids.- XidIsConcurrent(), when checking for a serializable conflict.These cases are less impactful than37a6e5d, but a bit ofmicro-benchmarking of this API shows that linear search speeds up by~20% depending on the number of items involved (x86_64 and amd64 lookedat here).Author: Nathan BossartReviewed-by: Richard Guo, Michael PaquierDiscussion:https://postgr.es/m/20220901185153.GA783106@nathanxps131 parent9a69152 commit14ff44f
2 files changed
+6
-16
lines changedLines changed: 4 additions & 8 deletions
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 |
| |
|
Lines changed: 2 additions & 8 deletions
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
Comments
(0)