Fix long spinning in rtree_node_init
rtree_node_init spinlocks the node, allocates, and then sets the node. This is under heavy contention at the top of the tree if many threads start to allocate at the same time. Instead, take a per-rtree sleeping mutex to reduce spinning. Tested both pthreads and osx OSSpinLock, and both reduce spinning adequately Previous benchmark time: ./ttest1 500 100 ~15s New benchmark time: ./ttest1 500 100 .57s
This commit is contained in:
@@ -28,7 +28,8 @@ typedef int witness_comp_t (const witness_t *, void *, const witness_t *,
|
||||
#define WITNESS_RANK_ARENA_EXTENT_CACHE 10
|
||||
|
||||
#define WITNESS_RANK_RTREE_ELM 11U
|
||||
#define WITNESS_RANK_BASE 12U
|
||||
#define WITNESS_RANK_RTREE 12U
|
||||
#define WITNESS_RANK_BASE 13U
|
||||
|
||||
#define WITNESS_RANK_LEAF 0xffffffffU
|
||||
#define WITNESS_RANK_ARENA_BIN WITNESS_RANK_LEAF
|
||||
|
Reference in New Issue
Block a user