3 ms·
I did some tweaking with my benchmark. I picked 11 threads due to my CPU having 12 logical cores. With 100 threads and incrementing 10 at a time, the LockBenc
by samsquire 4y ago
I did some tweaking with my benchmark.
I picked 11 threads due to my CPU having 12 logical cores.
With 100 threads and incrementing 10 at a time, the LockBenchmark achieves 3,482,053 requests per second.
With 100 threads the lock free benchmark achieves 17,754,858 requests per second, 10 messages sending per synchronization event at a time.
In other words, the lock free algorithm scales better.
LockBenchmark code
https://github.com/samsquire/multiversion-concurrency-control/blob/main/src/main/java/main/LockBenchmark.java https://github.com/samsquire/multiversion-concurrency-contro...
Lock free actor2 algorithm
https://github.com/samsquire/multiversion-concurrency-control/blob/main/src/main/java/main/Actor2.java https://github.com/samsquire/multiversion-concurrency-contro...
- zelphirkalt 4y agoI think this is to be expected. If you have a lock anywhere, the risk is, that the lock will become the bottleneck at some point when scaling to more and more concurrently running processes wanting to acquire the lock.