Reimplement ArrayPools using StampedLock to control concurrent access#3158
Reimplement ArrayPools using StampedLock to control concurrent access#3158
Conversation
To ensure better performance on Android, synchronized-block will be used there instead.
ArrayList shows slightly better performance compared to ArrayDeque
|
See benchmarking results below. tl;dr - on JVM, the proposed implementations show the same performance characteristics in single-threaded access scenario, and outperforms existing implementation if there's some contention. Raw results: |
|
While the proposed solution looks nice in theory, I don't see any improvements in TechEmpower benchmarks results (which is more or less expected, given that array acquisition from the pool take relatively small portion of time). However, when profile, TechEmpower benchmarks shows that StampedLock-based solution takes more time, compared to the baseline. It kinda contradicts results I see in microbenchmarks, and so far I don't understand why it is happening. |
|
@e5l Do you have any other workloads besides TechEmpower that you can test this change on? |
|
Nope, at the moment. But the most of the jsons are small, so it easy to spot it on medium load workload |
|
While it is visible, changing the profile does not affect the score. So maybe it's not needed after all. |
|
the bottle neck is shifted after this, we will keep pushing futher |
No description provided.