forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitac7d6f5
committed
Make use of initReadOnlyStringInfo() in more places
f0efa5a introduced the concept of "read-only" StringInfos which makesuse of an existing, possibly not NUL terminated, buffer.Here we adjust two places that make use of StringInfos to receive datato avoid using appendBinaryStringInfo() in cases where a NUL terminationcharacter is not required. This saves a possible palloc() and saveshaving to needlessly memcpy() from one buffer to another.Here we adjust two places which were using appendBinaryStringInfo().Neither of these cases seem particularly performance-critical. In thecase of XLogWalRcvProcessMsg(), the appendBinaryStringInfo() was onlyappending 24 bytes. The change made here does mean that we can get ridof the incoming_message global variable and make that local instead.The apply_spooled_messages() case applies in logical decoding whenapplying (possibly large) changes which have been serialized to a file.Reviewed-by: Amit KapilaDiscussion:https://postgr.es/m/CAApHDvoxYUDHwqPf-ShvchsERf1RzmkGoLwg63JNvHCkDCuyKQ@mail.gmail.com1 parent18b5851 commitac7d6f5
2 files changed
+13
-13
lines changedLines changed: 3 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2019 | 2019 |
| |
2020 | 2020 |
| |
2021 | 2021 |
| |
2022 |
| - | |
2023 | 2022 |
| |
2024 | 2023 |
| |
2025 | 2024 |
| |
| |||
2057 | 2056 |
| |
2058 | 2057 |
| |
2059 | 2058 |
| |
2060 |
| - | |
2061 | 2059 |
| |
2062 | 2060 |
| |
2063 | 2061 |
| |
| |||
2079 | 2077 |
| |
2080 | 2078 |
| |
2081 | 2079 |
| |
| 2080 | + | |
2082 | 2081 |
| |
2083 | 2082 |
| |
2084 | 2083 |
| |
| |||
2104 | 2103 |
| |
2105 | 2104 |
| |
2106 | 2105 |
| |
2107 |
| - | |
2108 |
| - | |
2109 |
| - | |
| 2106 | + | |
| 2107 | + | |
2110 | 2108 |
| |
2111 | 2109 |
| |
2112 | 2110 |
| |
|
Lines changed: 10 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
132 | 132 |
| |
133 | 133 |
| |
134 | 134 |
| |
135 |
| - | |
136 | 135 |
| |
137 | 136 |
| |
138 | 137 |
| |
| |||
425 | 424 |
| |
426 | 425 |
| |
427 | 426 |
| |
428 |
| - | |
429 | 427 |
| |
430 | 428 |
| |
431 | 429 |
| |
| |||
843 | 841 |
| |
844 | 842 |
| |
845 | 843 |
| |
846 |
| - | |
847 |
| - | |
848 | 844 |
| |
849 | 845 |
| |
850 | 846 |
| |
851 | 847 |
| |
852 |
| - | |
| 848 | + | |
| 849 | + | |
853 | 850 |
| |
854 | 851 |
| |
855 | 852 |
| |
856 | 853 |
| |
857 | 854 |
| |
858 |
| - | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
859 | 858 |
| |
860 | 859 |
| |
861 | 860 |
| |
| |||
870 | 869 |
| |
871 | 870 |
| |
872 | 871 |
| |
873 |
| - | |
| 872 | + | |
| 873 | + | |
874 | 874 |
| |
875 | 875 |
| |
876 | 876 |
| |
877 | 877 |
| |
878 | 878 |
| |
879 |
| - | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
880 | 882 |
| |
881 | 883 |
| |
882 | 884 |
| |
|
0 commit comments
Comments
(0)