vmware-archive / go-pmem-transaction

Golang library for using persistent memory
Other
29 stars 5 forks source link

Optimizations #20

Closed jerrinsg closed 5 years ago

jerrinsg commented 5 years ago

This commit (b1f8356) includes two optimizations: (1) When resetLogTail() is called, do not allocate a new backing array for the log arrays. Instead reuse the existing array by zeroing out the pointers (2) When the transaction unLock() function is called, do not allocate a new array to hold the mutex pointers. Instead reuse the same array by zeroing out the pointers.

Memtier benchmark throughput observed while running against go-redis-pmem:

Data size Clients Pipeline Before (MB/s) After (MB/s) Change
32 1 512 8.411 10.042 19.389 %
32 1 8 5.138 5.278 2.72 %
64 5 8 25.772 27.754 7.68 %
64 5 512 40.178 46.983 16.934 %
32-512 5 16 75.836 77.699 2.456 %
32-512 5 1024 117.432 126.0144 7.308 %
1024 1 4 33.464 35.995 7.56 %
1024 1 256 78.905 80.275 1.737 %

Memtier benchmark configurations: threads=1 ratio=1:1

pratapsu commented 5 years ago

I have looked over this change, and I don't believe I have any feedback.