Optimization: use 'put' instead of 'replace' for writes, not using the old value.
FossilOrigin-Name: b29c1d4059eb0a6d0191ab074fbc5073688f9626c8d310559f8c0c14ba904a5f
This commit is contained in:
parent
08b0bf1d5c
commit
b073d9ffa9
1 changed files with 1 additions and 2 deletions
|
|
@ -361,10 +361,9 @@ rmdbx_put_val( VALUE self, VALUE key, VALUE val )
|
||||||
rc = mdbx_del( db->txn, db->dbi, &ckey, NULL );
|
rc = mdbx_del( db->txn, db->dbi, &ckey, NULL );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
MDBX_val old;
|
|
||||||
MDBX_val data;
|
MDBX_val data;
|
||||||
rmdbx_val_for( self, val, &data );
|
rmdbx_val_for( self, val, &data );
|
||||||
rc = mdbx_replace( db->txn, db->dbi, &ckey, &data, &old, 0 );
|
rc = mdbx_put( db->txn, db->dbi, &ckey, &data, 0 );
|
||||||
xfree( data.iov_base );
|
xfree( data.iov_base );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue