Commit d090658
kvcoord: optimize txn write buffer for read-only txns
In the txn write buffer we need to merge the ScanResponse coming from
the server with any overlapping writes that we've buffered. This
requires us to allocate `respMerger.batchResponses` which is the
"staging" area of the merged response. However, if we don't have any
overlapping buffered writes, then we simply copy the server response
into that staging area. This commit adds an optimization to avoid this
extra copy in a special but common case when the buffer is empty (i.e.
we're in a read-only txn). We could extend the optimization further but
that is left as a TODO.
Release note: None1 parent ec2a260 commit d090658
1 file changed
+18
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1162 | 1162 | | |
1163 | 1163 | | |
1164 | 1164 | | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
1165 | 1174 | | |
1166 | 1175 | | |
1167 | 1176 | | |
| |||
1186 | 1195 | | |
1187 | 1196 | | |
1188 | 1197 | | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
1189 | 1207 | | |
1190 | 1208 | | |
1191 | 1209 | | |
| |||
0 commit comments