mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #8038 from heyitsanthony/txn-alloc
mvcc: don't use pointer for storeTxnRead in storeTxnWrite
This commit is contained in:
commit
0989780a77
@ -95,6 +95,7 @@ func BenchmarkStoreTxnPut(b *testing.B) {
|
||||
vals := createBytesSlice(bytesN, b.N)
|
||||
|
||||
b.ResetTimer()
|
||||
b.ReportAllocs()
|
||||
for i := 0; i < b.N; i++ {
|
||||
txn := s.Write()
|
||||
txn.Put(keys[i], vals[i], lease.NoLease)
|
||||
|
@ -51,7 +51,7 @@ func (tr *storeTxnRead) End() {
|
||||
}
|
||||
|
||||
type storeTxnWrite struct {
|
||||
*storeTxnRead
|
||||
storeTxnRead
|
||||
tx backend.BatchTx
|
||||
// beginRev is the revision where the txn begins; it will write to the next revision.
|
||||
beginRev int64
|
||||
@ -63,7 +63,7 @@ func (s *store) Write() TxnWrite {
|
||||
tx := s.b.BatchTx()
|
||||
tx.Lock()
|
||||
tw := &storeTxnWrite{
|
||||
storeTxnRead: &storeTxnRead{s, tx, 0, 0},
|
||||
storeTxnRead: storeTxnRead{s, tx, 0, 0},
|
||||
tx: tx,
|
||||
beginRev: s.currentRev,
|
||||
changes: make([]mvccpb.KeyValue, 0, 4),
|
||||
|
Loading…
x
Reference in New Issue
Block a user