bmatsuo / lmdb-go

Bindings for the LMDB C library
BSD 3-Clause "New" or "Revised" License
157 stars 59 forks source link

lmdb: finalizer for Cursor #28

Closed bmatsuo closed 8 years ago

bmatsuo commented 8 years ago

Relates to #20

Adding a finalizer for Cursor should be very easy. But care should be taken to ensure that benchmarks are in place and benchcmp is run before and after to quantify the overhead. Further, benchmarks for Cursor.Renew should be in place to further quantify its benefits.

bmatsuo commented 8 years ago

It seems that a finalizer may not be necessary for readonly cursors. Because the memory was allocated by LMDB it is reclaimed when the transaction terminates.