Repository navigation
Commit 59d1d1a
committed
perf(bigtable): build the entry proto once in createResource
MutateRowsBatchingDescriptor.createResource() built the same
MutateRowsRequest.Entry twice for every element added to a bulk-mutation
batcher: once through countBytes() to read the serialized size, and once
directly to read the mutation count. RowMutationEntry.toProto() memoizes
nothing, so the second construction was pure overhead, and BatcherImpl.add()
calls createResource for every accepted element.
Build the proto once and read both values from it. Behaviour-preserving.
Measured, this halves the bytes allocated per element.
MutateRowsBatchingDescriptorTest had no coverage of createResource or
createEmptyResource; both are added.1 parent 9337a93 commit 59d1d1a
2 files changed
Lines changed: 32 additions & 2 deletions
File tree
- java-bigtable/google-cloud-bigtable/src
- main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows
- test/java/com/google/cloud/bigtable/data/v2/stub/mutaterows
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
101 | 102 | | |
102 | 103 | | |
103 | 104 | | |
104 | | - | |
105 | | - | |
| 105 | + | |
| 106 | + | |
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
67 | 96 | | |
68 | 97 | | |
69 | 98 | | |
| |||
0 commit comments