Skip to content

Castroft/ConcurrentMemoryPool

Repository files navigation

优化前后的性能对比

优化前

4 threads execute 10 rounds concurrently, every round ConcurrentMalloc 10000 times, cost 105 ms 4 threads execute 10 rounds concurrently, every round ConcurrentFree 10000 times, cost 559 ms 4 threads execute 10 rounds concurrently, every round ConcurrentMalloc/Free 10000 times, cost 664 ms


4 threads execute 10 rounds concurrently, every round malloc 10000 times, cost 428 ms 4 threads execute 10 rounds concurrently, every round free 10000 times, cost 92 ms 4 threads execute 10 rounds concurrently, every round malloc/free 10000 times, cost 520 ms

使用基数树取代哈希表进行优化

4 threads execute 10 rounds concurrently, every round ConcurrentMalloc 10000 times, cost 260 ms 4 threads execute 10 rounds concurrently, every round ConcurrentFree 10000 times, cost 125 ms 4 threads execute 10 rounds concurrently, every round ConcurrentMalloc/Free 10000 times, cost 385 ms


4 threads execute 10 rounds concurrently, every round malloc 10000 times, cost 2378 ms 4 threads execute 10 rounds concurrently, every round free 10000 times, cost 1530 ms 4 threads execute 10 rounds concurrently, every round malloc/free 10000 times, cost 3908 ms

About

easy concurrent MemoryPool using the CSDN tutorial

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors