Change object caches from Queue to Deque or List
Opened 3 years ago
Last modified 3 years ago
#2263acceptedenhancement
Change object caches from Queue to Deque or List
Reported by:zzzOwned by:zzz Priority: minor Milestone: 0.9.36 Component: api/general Version: 0.9.34 Keywords:
Cc: Zlatin Balevsky Parent Tickets:
Sensitive: no
Description
ref: #2247
In a number of places we cache objects with a LinkedBlockingQueue? (LBQ). Original reason was to take advantage of separate locking for read and write sides. True?
LBQ has two downsides - additional object churn as each object must be wrapped, and less CPU cache hit ratio because it's not LIFO. Investigate and consider switching to Deque (still wrapped) or List (not). Either goes back to a single lock. Decision may be different for different use cases. A general helper class may also be useful.