Skip to content

Effect of removing std::uncaught_exceptions calls on OL obsoleting critical section enter and exit

Laurynas Biveinis edited this page Apr 22, 2021 · 5 revisions

The initial OLC ART implementation introduced unique_write_lock_obsoleting_guard class that took a write-locked lock in constructor and in destructor decided whether to write unlock and obsolete on normal path or just write unlock on error path by comparing std::uncaught_exceptions results in constructor and destructor. This did not work out due to guard lifetime extending beyond their variable scope due to copy elision (?) and I had to introduce explicit commit and abort calls, removing the need for decision in destructor, thus making std::uncaught_exceptions calls redundant.

Removing them has beneficial performance effect. Node4 microbenchmarks: a ~2% slowdown (large Node4 tree random gets) to a ~7% (sequential insert to full Node4) speedup. Node16: a ~5% slowdown (shrinking a large Node48 tree to Node16 tree randomly) to a ~4% speed up (adding to a Node16 tree sequentially). Node48: a ~0% (growing a small Node16 tree to Node48 randomly) to a 5% speed up (shrinking a Node256 tree to Node48). Node256: 3% slowdown (growing a small Node48 tree to Node256 sequentially) to a 5% speed up (adding to a Node256 tree randomly).

Clone this wiki locally